Across boundaries - ( Cipto )

Across boundaries

See also: Other Geeks@INDC

Now for this example : it's the role management page, i would like to group based on the report path.

such as sales activity consist of 2 : sales activiy branch report ,sales activity per region. CMU consist of three reports.as you can see below

this is the role management. and i would like to use ultraweblistbar Hosting ultrawebtree
ImageHost.org ImageHost.org

 

for the ultraweblist bar can host the ultrawebtree you can use:

1.internal class inherits from ITemplate(System.web.ui.ITemplate)

ex: internal class salesactivitytemplate:ITemplate
    {

        #region ITemplate Members

        public void InstantiateIn(Control container)
        {
            UltraWebTree salestree = new UltraWebTree();
            salestree.Nodes.Add("SalesActivityPerRO");
            salestree.Nodes.Add("SalesActivityperRegionBranch");
            salestree.CheckBoxes = true;
            container.Controls.Add(salestree);
        }

        #endregion
    }

and then set to this.UltraWebListbar1.Groups[0].Template = st; and so on and so on

2. Add a blank Web user control which i use this approach.. because you can retrieve the webtree control as a tree not split up to another control.

     protected void Page_Init(object sender, EventArgs e)
    {
        btnsubmit.Value = "Submit";
        btnsubmit.ServerClick += new EventHandler(btnsubmit_ServerClick);
        btnsubmit.Visible = false;
        btnreset.Visible = false;
        PlaceHolder1.Controls.Add(btnsubmit);
        PlaceHolder1.Controls.Add(btnreset);
        salesactivitytemplate st = new salesactivitytemplate();
        //this.UltraWebListbar1.Groups[0].Template = st;

        this.UltraWebListbar1.Groups[0].UserControlUrl = "MyWebUserControl.ascx";
        this.UltraWebListbar1.Groups[1].UserControlUrl = "MyWebUserControl.ascx";

        var i = this.UltraWebListbar1.Groups[0].UserControl;
        UltraWebTree salestree = new UltraWebTree();
        salestree.ID = "salestree";
        salestree.LeafNodeImageUrl = "~/images/ig_treeXPFolderClosed.gif";
        salestree.Nodes.Add("SalesActivityPerRO");
        salestree.Nodes.Add("SalesActivityperRegionBranch");
        salestree.CheckBoxes = true;
        salestree.ClientSideEvents.NodeChecked = "TreeNodeChecked";
        i.Controls.Add(salestree);


        var d = this.UltraWebListbar1.Groups[1].UserControl;
        UltraWebTree cmutree = new UltraWebTree();
        cmutree.ID = "cmu";
        cmutree.LeafNodeImageUrl = "~/images/ig_treeXPFolderClosed.gif";
        cmutree.Nodes.Add("ProductivityReport");
        cmutree.Nodes.Add("SLAperAppraisalReport");
        cmutree.Nodes.Add("TATmoreSLAReport");
        cmutree.ClientSideEvents.NodeChecked = "TreeNodeChecked";
        cmutree.CheckBoxes = true;
        d.Controls.Add(cmutree);

    }

 

 as for taking the webtree value, when Post or submit 

i've got to double unbox it.

  private List<UltraWebTree> GetMywebtrees()
    {
        List<UltraWebTree> mywebtrees;
        List<MyControls.MyWebUserControl> some =
            (from Group tmp in UltraWebListbar1.Groups
             select tmp.UserControl).Cast<MyControls.MyWebUserControl>().ToList();

        mywebtrees=(from MyControls.MyWebUserControl g in some select g.Controls
                    into temporary
                        from Control g in temporary
                        select g).Cast<UltraWebTree>().ToList();
        return mywebtrees;
    }

  void btnsubmit_ServerClick(object sender, EventArgs e)
    {
       
        List<UltraWebTree> mywebtrees = new List<UltraWebTree>();
        mywebtrees = GetMywebtrees();
        mywebtrees.Foreach<UltraWebTree>(new Action<UltraWebTree>(CheckEveryNodesinTree));
    }

 private void CheckEveryNodesinTree(UltraWebTree tree)
    {
        foreach (Node o in tree.Nodes)
        {
            if(o.Checked)
            {
                //o.Text
                //TODO: Add Logic like Chkmneluist.checked, check if !User.isinrole(username,role){ Roles.adduser(username,o.text)

            }
            else
            {
                //TODO: Add Logic like Chkmneluist.checked, reverse above
            }
        }
    }

 Lastly to change the Icon When User click or unclick use the javascript.

Every nodes that we got . has 3 childrens and number 2 is the image .

   function TreeNodeChecked(treeId, nodeId, bChecked) {
        var d = document.getElementById(nodeId);
        var e = d.children[2];
        try
        {
        if (bChecked) {
            e.src= '../images/ig_treeXPFolderOpen.gif';
        }
        else {
            e.src= '../images/ig_treeXPFolderClosed.gif';
        }
        }
        catch(e)
        {
        alert(e);}
    }

Final Result UI:

 Listbar type

ImageHost.org
Explorer Type

ImageHost.org
Share this post: | | | |
Posted by cipto | with no comments
Filed under:

 I did some learning on these.

but not too deep.

just a shallow one.

  • how to make a property like tree ? inherit from ExpandableObjectConverter
  • how to create type converter
  • how to build custom action lists and designers
  • how to tap into vs automation object model.
  • Build own type editor

all of this need to be researched more deeply if , the time allows me

:)

 

 

 

 

Share this post: | | | |
Posted by cipto | with no comments

VSTS Team suite include all of the 4 other's VSTS

VSTS Database Edition,VSTS Architecture Edition,VSTS Development Edition,VSTS Testing Edition.

if you haven't read the article 10 things you should know vsts then better search it.

 

You should install the VSTS Database Power Tools, VSTS Architecture Power tools

the Database edition power tools , Give's u extraordinary tools, Almost The same like RedGate- SQLBELT

Schema Compare, You can compare the schema(table, view,storeproc,function)  From one DB to another DB. Cool, and you can choose to create,update or skip the difference, in one button deploy to the target db

Data Compare,you can compare data from one instance db to another.

Refactor, ex: you want to change the schema from Sales to Marketing etc

DataGenerator-> Create your own Dummy data? Mew using regular expression. and you can choose how many rows

TSQL Editor-> Your own editor in single IDE WIndow MEW

Static Code analysis-> Mew they can even analyze your store proc,the query performance,etc.

And you can create your Database Test,

Create Database Project-> every schema would own it's .sql query. RIght click deploy , and whoala it's created for you.

 

 VSTS Architecture Power tools, give you the ability to create diagram

 For Abstract High level application one. you can click drag your solution projects link them together, create the webservice

and when you click to Implemet all . it's created for you, the power tools, give you the ability to create class library.

 

VSTS Development edition, Class diagram, etc.

 

VSTS Test Edition Give's you all the ability test that you can't find on other edition, such as Web Test, Load Test,Peformance Test

with web test we can see like other debugging proxy, and also can create rules for the responses etc.

for the load Test we can create like a stress tools, how many user log to our web

For the performance test, we can generate binary2 and then test it to our application and see the impact.

 

Combine these VSTS , and then The TFS , whoalah it's a complete Cycle.

:)

Top Markotok

 

 

Share this post: | | | |
Posted by cipto | with no comments
Filed under:

You can Create your own Visualizer while Debugging a type, say likethe example on the book,you can use an image debugging viewer , create Your own winform and Controls,

Right klik add new Debugger Visualizer on your classlibrary,

add the Form etc  put your logic on Show method.

Compiled put the dll on your visualizer folder on mydocument->visualstudio2008->visualizer

You can also Customize how the look When Debugging a type.

 Create an Internal Class , inside your class.

 Ex:

    internal class RbmProxy
        {
            private RBMInput RBM;
            public RbmProxy(RBMInput rbm)
            {
                RBM = rbm;
            }
            [DebuggerBrowsable(DebuggerBrowsableState.Never)]
            public string BirNumber { get { return RBM.SplitRawinput[1].ToString(); } }
            public string CustomerName { get { return RBM.SplitRawinput[2].ToString(); }
            }
            public string RBMCode { get { return RBM.SplitRawinput[3].ToString(); }
            }
            public DateTime DateReceived { get { return Convert.ToDateTime(RBM.SplitRawinput[4].ToString()); }
            }
            public DateTime DateIn { get { return Convert.ToDateTime(RBM.SplitRawinput[5].ToString()); }
            }
            public DateTime ProcessDate { get { return Convert.ToDateTime(RBM.SplitRawinputDevil.ToString()); }
            }
            public DateTime DateOut{ get { return Convert.ToDateTime(RBM.SplitRawinput[7].ToString()); }
            }
            public string status{ get { return RBM.SplitRawinputMusic.ToString(); }
            }
            public DateTime CaDate { get { return Convert.ToDateTime(RBM.SplitRawinput[9].ToString()); }
            }
            [DebuggerDisplay("{ValidationRules()}")]
            public string BusinessRulesViolation { get { return string.Empty; } }
            private string ValidationRules()
            {
                StringBuilder sb = new StringBuilder();
                if(BirNumber.Length<14) sb.Append("BirNumber can not less than 14;");
                if (DateOut < DateIn) sb.Append("Date Out Must be Larger than Date In;");
                if(!status.Equals("PASS") && !status.Equals("NO PASS"))
                sb.Append("Status can only be filled with 'PASS' or 'NO PASS';");
                return sb.ToString();
            }

 

add the debugger type proxy to your class

    [DebuggerTypeProxy(typeof(RbmProxy))]
    public class RBMInput : BaseGenericInput
    {

 

 when you run it , and on the debug mode you should see the debugger has already change the behaviour

 

 

Share this post: | | | |
Posted by cipto | with no comments
Filed under:

It's been a long and nice holiday. get ready to start your engine a.k.a Brain and mentality for the upcoming projects.

There are many tools that i unduh(Download)

Nevron Net Vision Enterprise, Download and try the demo but the Analyze one does not run. any idea what this is for?

Dissharp is used for like reflector,but user friendly, can view ildasm, what good can change code/dll from c# to VB or Delphi or CHROME IN A ZIP.
VSTRac is for used with trac open project (WIKI)
Aspose word Transfer, Can Generate Document(TEXT) into Word 2003,OpenXML 2007,PDF,Txt,Rich Test,Barcode Genrator.

Resharper 4.1

FxCop

Stylecop Plugin for resharper

SQL Assistant for Bringing the Intelese in your SQL management->Query (Cool)

Visual SVN 1.5 (Integrator Tool for subversion in visual studio)

SQL Tool Belt - RedGate

SyncroSVN Client v.4.0 - Helps u when merging the conflict

MZ.Tools.6.0.For.VS.NET.Enterprise.Editon - Kind like of external tools for IDE, not so usefull

MathML.NET.Control.v.2.1.6.0 - TOP BGTTTTTTT

ComponentArt.WebUI.2008.1.1085.3.For.ASP.NET.Ajax - Now this is something, Elegant, Nice Look, Nice Feauter, Fastttt Ajax not like those infra 

Data.Dynamics.Reports.v1.0.63.0 -  as it names implies , for generate reporting,Support vs2005 only

 

Share this post: | | | |
Posted by cipto | 2 comment(s)
Filed under:
Uninstalling GAX/GAT Failed

Download and run the msicuu2.exe, remove the gax and gat.
Download the GaxTroubleshooter.exe run it
When you run the GAT installer again and it still say that can not install previous gax is still installed, remove the entry in registry which still left over
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Packages\{23fc29c9-fafe-47f1-b633-b548e788dddf}

Installing Ent lib may 2007 , error 1001
error 1001 the project factory csharp is not registered.
I uninstalled the visual studio 2005. then it disappeard but lead to another error
L sigh. I tried to change the msi targetting on 9.0 using orca msi.but can not
The solution is simple Install again visual studio 2005 cause the may 2007 still targeting 2005.

When you click new project and go to webclient software factory noticed that if You have More than 4 Templates there, all scattered in one place more than 4. Try uninstalling the gax , gat and then webclientsoftware factory and then install gax, gat and webclientsoftwarefactory again.
That should solved it
Share this post: | | | |
Posted by cipto | with no comments

after down for 3 days , all the blog that revive is till mid august..

i can't remember what i;ve posted.annoying.

i'll look for another blogs Host.

Hrrrgh , virtu what?

 

Share this post: | | | |
Posted by cipto | with no comments

 

When Using Event Log on Asp.net it Shows Requested registry access is not allowed If it shows http 500 , disable the show friendly message on your ie browsers first then you can see the error message. 

Grant permission to create a custom event log  

1.    Log on to the computer as an administrator.
2.    Click Start, click Run, type regedit in the Open box, and then click OK. The Registry Editor window appears.
3.    Locate the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog
4.    Right-click Eventlog, and then click Permissions. The Permissions for Eventlog dialog box appears.
5.    Click Advanced. The Advanced Security Settings for Eventlog dialog box appears.
6.    In the Name column, double-click the Users group. The Permission Entry for Eventlog dialog box appears.
7.    Select the Set Value check box, select the Create Subkey check box, and then click OK.
8.    Quit Registry Editor, and then log off from the administrator account.
9.    Log on to the computer as a regular user.
10.  Try to create a custom event log by using Visual Studio .NET, and then try to write to this event log by using an application that is built on Visual Studio .NET. 

When Using Pop3,SMTP Shows Socket 1004: forcibly closed by remote host.

Could be hardware failure, could be dns problem,

Try change the host from computer name to IP

When Using Windows Service the System.Timer is not Firing.

I switch to System.threading.Timer.

System.Threading.Timer t = new System.Threading.Timer(

new System.Threading.TimerCallback(RunCommands),        null,      

0, Convert.ToInt32(ConfigurationManager.AppSettings["IntervalMinutes"])        );  

}       

public static void RunCommands(object stateInfo)      

  {         //do something   }

You can pass any object/custom object to null,this is common for callback architecture. Or another approach which I haven’t tried is to use GC.KeepAlive(System.Timer)

Share this post: | | | |
Posted by cipto | 2 comment(s)
Filed under:

 

I’ve seen this on scott gu’s blog that refer to another blog. What interesting here is When you Replace your <asp:Script Manager> with <cc1:ToolkitScriptManager>

It supports script combining every script resource on the page.

 

Merge Multiple client-side javascript into a single file that is download to the client at runtime.

 

If you put so many toolkit on your page, you will see it generates separate script resource.and as you suspect with so many file, it has to go back and forth to download the file when needed.

Before

 

 

  After

 

WITH

MiliSECONDS:8840

Ukuran:542265

Waktu Load: 2 second

 

WITH OUT

MIlliSencods:21929

Waktu Load: 3 second

Ukuran:280157

 

 

Save 9 roundtrip

Share this post: | | | |
Posted by cipto | with no comments
Filed under:

 Creating Master Detail, one To Many ListView with Ajax.

Edit

 

 

Add

 

Insert Branches

 

 Paging Style

 

On List View or simillar type of control , you can state commandname on your linkbutton or button .

What have been recognized is insert,update,delete,cancel and custom. This will trigger event iteminserted(&ing), itemupdated(&ing),..delete,..cancel,item command.

If you want to submit changes

onbuttonclick

//this will purge all the data from grid to //datasource

foreach (ListViewDataItem item in ListView1.Items)

{

ListView1.UpdateItem(item.DataItemIndex, true);

For the Skin and modal pop up goto  http://mattberseth.com

To enable page method first you must enable it on the script manager/toolscriptmanager

Second add the Scriptmethod attribute

[WebMethod]
[System.Web.Script.Services.ScriptMethod()]

And then on the client script use the method it’s under PageMethod object.

So PageMethods.MyMethodName(param a, param b);

You can Take the Value of Eval and Compare it, but first unbox the type first, because Eval is Box to Object

Ex:Visible='<%# ((string)Eval("Type")=="Admin")

Remember that Eval is one way binding(read), Bind is two way binding.

I prefer using link button on the template, it saves space and neat not like button so ugly and take space

Source

CodeMappingsInput.zip

 

 

 

 

Share this post: | | | |
Posted by cipto | 1 comment(s)
Filed under:

Inline script False

Inline Script True

 

Share this post: | | | |
Posted by cipto | 4 comment(s)

 

after viewing the video.and browse some msdn. the most obvious example is when you are using mobile browser .it is probably in the context of providing alternate renderings of controls for mobile devices 

Adapter is used to intercept the default rendering behaviour for an asp.net server control.mostly not required but for some cases . for customized rendering with different browser.

 

there are 4 types actually, but i haven't explore yet.

you can a class that inherit webcontroladapter

usually overrides 3 method, begin render tag, end render tag, and render contents.

you can customize a server control default rendering way.

 

after that you add the new item -> browser file.

and bind which adapter for which server control and for which browser

 

ex:

<browsers>

//default means for every browser

<browser refID="Default">

 <controlAdapters>

<adapter controlType="namaspace.namacontrol" adapterType="namaclassadapterkamu:"/>

 

 

 

Share this post: | | | |
Posted by cipto | with no comments
Filed under:

whoah it's been 1 days to solve this issue,

everything below is using local report with SSRS not report server.

when using localreport with Microsoft report viewer, been quite a mystery, when somethings got wrong , it just display simple error which also a mystery. i search the net but found not a brief explanation

any way , when you are using sub report, the trouble gots higher.

you've got to manually bind the value for each object data source.

First step is to add event handler

Page load

{

     ReportViewer1.LocalReport.SubreportProcessing += new Microsoft.Reporting.WebForms.SubreportProcessingEventHandler(LocalReport_SubreportProcessing);
   
     ReportViewer1.ReportRefresh += new System.ComponentModel.CancelEventHandler(ReportViewer1_ReportRefresh);
    }

    void ReportViewer1_ReportRefresh(object sender, System.ComponentModel.CancelEventArgs e)
    {
        ObjectDataSource1.DataBind();
        ObjectDataSource2.DataBind();
        ObjectDataSource3.DataBind();
    }
////this is processed row by row

//you've got to attach the report parameter to object datasource

//on local mode you need to do this

   void LocalReport_SubreportProcessing(object sender, Microsoft.Reporting.WebForms.SubreportProcessingEventArgs e)
    {

        e.DataSources.Add(new ReportDataSource("SubWipproposal_WipProposal", "ObjectDataSource2"));
        ObjectDataSource2.SelectParameters[0].DefaultValue = e.Parameters[0].Values[0];
        e.DataSources.Add(new ReportDataSource("PipeLineDataset_GetProducttype", "ObjectDataSource3"));
        ObjectDataSource3.SelectParameters[0].DefaultValue = e.Parameters[1].Values[0];
        ObjectDataSource3.SelectParameters[1].DefaultValue = e.Parameters[0].Values[0];

    }

Error: SubReport could not be shown

Solution:

1.Check every data source: the main report and the sub report , by clicking vside menu , report ->Datasource , already included the source of your report, add as necessary

2.Check  the naming of the dataset,report ->Datasource,must match  from the add report datasourcename (case sensitive) on subreportprocessing event

3.CHeck that your sub report parameters already define the same as the parameters being pass from main report

Error: "Text box.A Scope..."    

Solution: for multiple dataset in one report you  need to define the scope of each textbox. for ex:(=First(Fields!producttype.Value, "PipeLineDataset_GetProducttype") the bold one is the scope

 

when using multiple datasource, it's better to use .List and then in that list there's a sub report

Hope this help

Mark as answer :) :)

Share this post: | | | |
Posted by cipto | with no comments
Filed under:

ok, i've seen my friend use zooming tool on .net ide. but i don't now if this is the one.

any way sometimes my monitor resolution is too small, i can't see the god damn code.

then use this tool

http://technet.microsoft.com/en-us/sysinternals/bb897434.aspx

when u press ctrl 1(Default=>can bee customized

it enlarge and you can scroll to make it larger

 

 one feature that i like, and it helps u when you are stress is drawing on the ide

 :) Syaloom

Share this post: | | | |
Posted by cipto | with no comments

one of my developer fellow ask me his name is manumpak, 

how do i make previlleges for pages and combining them by restricting/hidding the menu based on role.

in indonesian="Bagaimana caranya supaya Halaman hanya bisa di buka berdasarkan peranan Mis: Sales hanya bisa lihat report sales, Marketing lihat Marketing report Dan Menunya di halaman default bisa hilang(Sesuai Peranan))".

approach:

1. can code on master page

2. on base page

OR

u can use security trimming from asp.net 2.0.

 1. Enabled on web.config

 <system.web>
    <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
      <providers>
        <add name="XmlSiteMapProvider" description="Default SiteMap provider" type="System.Web.XmlSiteMapProvider" siteMapFile="Web.sitemap" securityTrimmingEnabled="true"/>
      </providers></siteMap>

 2.Make Every SiteMapNode on Web.sitemap contains Roles statement

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"  >
    <siteMapNode url="Default.aspx" title="Home"  description="Home" roles="SME,EWO,CSA,FACTORY,Commercial">
      <siteMapNode url="SalesSME.aspx" title="Sales SME"  description="Sales SME" roles="SME" />
      <siteMapNode url="EWO.aspx" title="EWO"  description="EWO" roles="EWO"/>     
    </siteMapNode>
</siteMap>

 3. There are connection between these sitemapnode to authorization tag, which must specify to make this Trimming works(THIS IS THE MAIN TRICK

 <location path="EWO.aspx">
        <system.web>
            <authorization>
                <allow roles="EWO"/>
                <deny users="*"/>
            </authorization>
        </system.web>
    </location>
  <location path="SalesSME.aspx">
    <system.web>
      <authorization>
        <allow roles="SME"/>
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>

 4. To Test it make a user and give role to it.

 on global asax place these following code:

void Application_Start(object sender, EventArgs e)
    {
        // Code that runs on application startup
        //Create Role
        if(!Roles.RoleExists("Commercial"))
            Roles.CreateRole("Commercial");
        if (!Roles.RoleExists("CSA"))
            Roles.CreateRole("CSA");
        if (!Roles.RoleExists("EWO"))
            Roles.CreateRole("EWO");
        if (!Roles.RoleExists("Factory"))
            Roles.CreateRole("Factory");
        MembershipUser cipto = Membership.GetUser("cipto");
        if (cipto == null)
        {
            try
            {
                Membership.CreateUser("cipto", "ciptodeveloperterganteng","cipto@Plasxxxxx.com");
                Roles.AddUserToRole("cipto", "EWO");
            }
            catch (Exception ex)
            {
           
            }
        }
       
    }

5. Create The menu on Default Page.you can use asp TREE, or ultrawebmenu and place sitemapdatasource

 

 6. Deny anonymous authorization '?'

 7. Login from your login page .

8.You should see only EWO menu

 

 jamekovacs have made own httpmodule, map from exists role from ntaccount if windows authentication and from Roles if Form authentication.

and map to an xml, so we just modified the xml for easiness.

 http://www.jameskovacs.com/blog/DevelopingAndTestingRoleBasedASPNETApplicationsWithImpostorHttpModule.aspx

you can add the httpmodule on web.config

    <httpModules>
            <add name="ImpostorHttpModule" type="JamesKovacs.Web.HttpModules.ImpostorHttpModule, JamesKovacs.Web.HttpModules"/>
    

There you are. Hope it helps.

Have a nice week end

Share this post: | | | |
Posted by cipto | 2 comment(s)
Filed under:
More Posts Next page »