private void RaiseCanExecuteChanged(object sender, EventArgs e)
 {
     DraftCommand.RaiseCanExecuteChanged();
     TemporaryCommand.RaiseCanExecuteChanged();
     EndCommand.RaiseCanExecuteChanged();
     BackFromEndCommand.RaiseCanExecuteChanged();
     PermanentCommand.RaiseCanExecuteChanged();
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        //ConnectionBean.ConnectionString = "Data Source=CR-ML150;Initial Catalog=samba_spds;User ID=sa;Password="******"UserId"] = Session["U_NAME"].ToString();

            DraftEntity       = RuntimeClassLoader.GetEntity(objectName) as DraftCommand;
            BeneficiaryEntity = RuntimeClassLoader.GetEntity("Beneficiary") as BeneficiaryCommand;
            RemmittanceEntity = RuntimeClassLoader.GetEntity("Remittance") as RemittanceCommand;
            RemmitterEntity   = RuntimeClassLoader.GetEntity("Remitter") as RemitterCommand;
            PODEntity         = RuntimeClassLoader.GetEntity("POD") as PODCommand;

            entityDataManager      = RuntimeClassLoader.GetDataManager(objectName);
            draftdatamanager       = RuntimeClassLoader.GetDataManager(objectName);
            Remittancedatamanager  = RuntimeClassLoader.GetDataManager("Remittance");
            Beneficiarydatamanager = RuntimeClassLoader.GetDataManager("Beneficiary");
            Remitterdatamanager    = RuntimeClassLoader.GetDataManager("Remitter");
            poddatamanager         = RuntimeClassLoader.GetDataManager("POD");
            if (!IsPostBack)
            {
                Session["RowId"]   = 0;
                Session["DraftNo"] = "";

                this.btnHoldReleasedraft.Enabled = true;

                //btnTextCodeLookup.Attributes.Add("onclick", "wid=window.showModalDialog('../LOV/ListOfRecord.aspx?DataManager=DefaultMessages&Id=0&Entity=" + "" + "&Text=Text Code List&Values="+""+"&ListType=LookupList', 'CS', 'left=250,top=165,height=400, width= 500 ,menubar=no,location=no,toolbar=no,scrollbars=yes,resizable=no');");

                txbDraftCurrency.Attributes.Add("style", "text-align: right;");

                this.btnTextCodeSearch.Attributes.Add("style", "visibility: hidden;");
                txbTextCode.Attributes.Add("onchange", "return SearchTextCode();");


                //-----------This two lines create error---------
                //rslt = (entityDataManager as DraftDataManager).GetAllHolded();
                //Session["DataSource"] = rslt.dstResult.Tables[0];

                //btnHolded.Attributes.Add("onclick", "wid=window.showModalDialog('../LOV/ListOfRecord.aspx?DataManager=Draft&Id=0&Entity=" + "" + "&Text=Draft List&Values=" + "" + "&ListType=SetupList&IsDataSource=1', 'CS', 'left=250,top=165,height=400, width= 500 ,menubar=no,location=no,toolbar=no,scrollbars=yes,resizable=no');");

                Session["GetAll"] = "HoldReleaseDraft";
                //btnReleased.Attributes.Add("onclick", "wid=window.showModalDialog('../LOV/ListOfRecord.aspx?DataManager=Draft&Id=0&Entity=" + "" + "&Text=Draft List&Values=" + "" + "&ListType=SpecificList', 'CS', 'left=250,top=165,height=400, width= 500 ,menubar=no,location=no,toolbar=no,scrollbars=yes,resizable=no');");
                //((ScriptManager)Master.FindControl("ScriptManager1")).SetFocus(txbTextCode);
                Session["drv"] = "";
                Session["drw"] = "";
            }

            /*
             *  if ((int)Session["RowId"] > 0 && Session["DraftNo"].ToString().Length > 0 && btnHoldReleasedraft.Text == "Hold Draft")
             *      btnHoldReleasedraft.Attributes.Add("onclick", "wid=window.showModalDialog('../Transaction/MiscellaneousMsg.aspx?DraftId=" + Session["RowId"].ToString() + "&PriorityCode=601&DraftNo=" + Session["DraftNo"].ToString() + "&HoldReason=" + txbHoldReason.Text + "',null,'status:no;dialogWidth:1200px;dialogHeight:850px;dialogHide:true;help:no;scroll:yes');");
             *  else
             *  {
             *      btnHoldReleasedraft.Attributes.Remove("onclick");
             *  }*/
        }
        catch (Exception ex)
        {
            lbl_Message.Text = ex.Message;
            // DataManager.SQLManager.LogException("HR_Transaction_CourierFeedback", "Page_Load", ex, Session["UserId"].ToString());
        }
    }