protected void GridView1_DataBinding(object sender, EventArgs e)
    {
        GridView gridView = sender as GridView;

        gridView.DataSource = dsDetailView;
        dsDetailView.SelectParameters["CategoryID"].DefaultValue = ASPxGridView.GetDetailRowKeyValue(gridView).ToString();
    }
    protected void ASPxGridViewDetail_Init(object sender, EventArgs e)
    {
        string MasterKeyValue = (ASPxGridView.GetDetailRowKeyValue(sender as ASPxGridView)).ToString();

        ObjectDataSource2.SelectParameters["masterKey"].DefaultValue = MasterKeyValue;
        ObjectDataSource2.InsertParameters["masterKey"].DefaultValue = MasterKeyValue;
        ObjectDataSource2.UpdateParameters["masterKey"].DefaultValue = MasterKeyValue;
        ObjectDataSource2.DeleteParameters["masterKey"].DefaultValue = MasterKeyValue;
    }
    protected void ASPxTreeList1_Init(object sender, EventArgs e)
    {
        ASPxTreeList treeList = sender as ASPxTreeList;
        object       keyValue = ASPxGridView.GetDetailRowKeyValue(treeList);

        if (keyValue.Equals(2) || keyValue.Equals(5))
        {
            treeList.RootValue = keyValue;
        }
    }
Exemple #4
0
        protected void btnReceipts_Click(object sender, EventArgs e)
        {
            string       PatientID = ASPxGridView.GetDetailRowKeyValue(sender as Control).ToString();
            ASPxGridView gvPatient = ASPxGridView.FindParentGridTemplateContainer(sender as Control).Grid;
            string       DoctorID  = gvPatient.GetMasterRowKeyValue().ToString();
            string       ClinicID  = ASPxGridView.FindParentGridTemplateContainer(gvPatient).Grid.GetMasterRowKeyValue().ToString();

            dsReceipts.SelectParameters["PatientID"].DefaultValue = PatientID;
            dsReceipts.SelectParameters["DoctorID"].DefaultValue  = DoctorID;
            dsReceipts.SelectParameters["ClinicID"].DefaultValue  = ClinicID;
            popupReceipts.AllowDragging  = true;
            popupReceipts.AllowResize    = true;
            popupReceipts.ResizingMode   = DevExpress.Web.ASPxClasses.ResizingMode.Live;
            popupReceipts.ShowOnPageLoad = true;
        }
        protected void CreateButton_Click(object sender, EventArgs e)
        {
            string key = ASPxGridView.GetDetailRowKeyValue((Control)sender).ToString();

            ViewState["SecretaryID"] = key;
            SecertaryRepository secertaryRepository = new SecertaryRepository();
            string UserID = secertaryRepository.GetUserIDBySecertaryID(int.Parse(key));

            if (UserID == null)
            {
                popup.Left           = 400;
                popup.Top            = 600;
                popup.ResizingMode   = DevExpress.Web.ASPxClasses.ResizingMode.Live;
                popup.ShowOnPageLoad = true;
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('This Secretary Has An Account ');", true);
            }
        }
        protected void ChangePasswordpopup_Click(object sender, EventArgs e)
        {
            string key = ASPxGridView.GetDetailRowKeyValue((Control)sender).ToString();

            ViewState["SecretaryID"] = key;
            SecertaryRepository secertaryRepository = new SecertaryRepository();
            string UserID = secertaryRepository.GetUserIDBySecertaryID(int.Parse(key));

            ViewState["UserID"] = UserID;
            if (UserID != null)
            {
                lblUserName.Text             = secertaryRepository.getUserNameByUserID(UserID);
                ChangePSpopup.Left           = 400;
                ChangePSpopup.Top            = 600;
                ChangePSpopup.ResizingMode   = DevExpress.Web.ASPxClasses.ResizingMode.Live;
                ChangePSpopup.ShowOnPageLoad = true;
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('This Secretary Don't Have An Account ');", true);
            }
        }