Exemplo n.º 1
0
 private void btnCreate_Click(object sender, EventArgs e)
 {
     if (btnCreate.Enabled)
     {
         En = EnumCED.Create;
         gridControl1.Enabled = false;
         HelpClass1.InActiveButtons(panelControl2);
         HelpClass1.ClearControls(panelControl1);
         HelpClass1.ActiveControls(panelControl1);
         txtName.Focus();
     }
 }
Exemplo n.º 2
0
 private void btnCreate_Click(object sender, EventArgs e)
 {
     if (btnCreate.Visible)
     {
         En = EnumCED.Create;
         gridControl1.Enabled = false;
         HelpClass1.InActiveButtons(panelControl2);
         HelpClass1.ClearControls(xtraTabPage1);
         HelpClass1.ActiveControls(xtraTabPage1);
         btnNewCode_Click(null, null);
         txtName.Focus();
     }
 }
Exemplo n.º 3
0
 private void btnCreate_Click(object sender, EventArgs e)
 {
     if (btnCreate.Visible)
     {
         En = EnumCED.Create;
         gridControl1.Enabled = false;
         FillcmbMajmoehaList();
         HelpClass1.InActiveButtons(panelControl2);
         HelpClass1.ClearControls(xtraTabPage1);
         HelpClass1.ActiveControls(xtraTabPage1);
         // txtCode.ReadOnly = true;
         // xtraTabControl1.SelectedTabPageIndex = 0;
         cmbMajmoehaList.Focus();
     }
 }
Exemplo n.º 4
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (btnEdit.Enabled)
            {
                if (gridView1.RowCount > 0)
                {
                    gridControl1.Enabled = false;
                    EditRowIndex         = gridView1.FocusedRowHandle;
                    En = EnumCED.Edit;
                    HelpClass1.InActiveButtons(panelControl2);
                    HelpClass1.ActiveControls(panelControl1);

                    txtId.Text   = gridView1.GetFocusedRowCellValue("Id").ToString();
                    txtName.Text = gridView1.GetFocusedRowCellValue("Name").ToString();

                    txtName.Focus();
                }
            }
        }
Exemplo n.º 5
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (btnEdit.Visible)
            {
                if (gridView1.RowCount > 0)
                {
                    gridControl1.Enabled = false;
                    EditRowIndex         = gridView1.FocusedRowHandle;
                    En = EnumCED.Edit;
                    HelpClass1.InActiveButtons(panelControl2);
                    HelpClass1.ActiveControls(xtraTabPage1);
                    // xtraTabControl1.SelectedTabPageIndex = 0;

                    txtId.Text          = gridView1.GetFocusedRowCellValue("MsUserId").ToString();
                    txtCode.Text        = gridView1.GetFocusedRowCellValue("UserCode").ToString();
                    txtName.Text        = gridView1.GetFocusedRowCellValue("Name").ToString();
                    txtShenase.Text     = gridView1.GetFocusedRowCellValue("Shenase").ToString();
                    txtPassword.Text    = gridView1.GetFocusedRowCellValue("Password").ToString();
                    chkIsActive.Checked = Convert.ToBoolean(gridView1.GetFocusedRowCellValue("UserIsActive"));

                    if (txtName.Text == "مدیر سیستم")
                    {
                        chkEditCode.Enabled   = false;
                        txtName.Enabled       = false;
                        chkIsActive.Enabled   = false;
                        labelControl5.Enabled = false;
                    }
                    else
                    {
                        chkEditCode.Enabled   = true;
                        txtName.Enabled       = true;
                        chkIsActive.Enabled   = true;
                        labelControl5.Enabled = true;
                    }
                    CodeBeforeEdit     = txtCode.Text;
                    NameBeforeEdit     = txtName.Text;
                    ShenaseBeforEdit   = txtShenase.Text;
                    IsActiveBeforeEdit = chkIsActive.Checked;
                    txtName.Focus();
                }
            }
        }
Exemplo n.º 6
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (btnEdit.Visible)
            {
                if (gridView1.RowCount > 0)
                {
                    gridControl1.Enabled = false;
                    EditRowIndex         = gridView1.FocusedRowHandle;
                    En = EnumCED.Edit;
                    HelpClass1.InActiveButtons(panelControl2);
                    HelpClass1.ActiveControls(xtraTabPage1);
                    FillcmbMajmoehaList();
                    // xtraTabControl1.SelectedTabPageIndex = 0;

                    cmbMajmoehaList.EditValue = Convert.ToInt32(gridView1.GetFocusedRowCellValue("MsMajmoeId").ToString());
                    cmbVahedhaList.EditValue  = Convert.ToInt32(gridView1.GetFocusedRowCellValue("MsVahedId").ToString());
                    cmbShobeList.EditValue    = Convert.ToInt32(gridView1.GetFocusedRowCellValue("MsShobeId").ToString());
                    txtShobeCode.Text         = gridView1.GetFocusedRowCellValue("DoreMaliCode").ToString().Substring(0, 6);
                    txtId.Text             = gridView1.GetFocusedRowCellValue("MsDoreMaliId").ToString();
                    txtCode.Text           = gridView1.GetFocusedRowCellValue("DoreMaliCode").ToString().Substring(6);
                    txtDoreMali.Text       = gridView1.GetFocusedRowCellValue("DoreMali").ToString();
                    txtStartDore.EditValue = gridView1.GetFocusedRowCellValue("StartDoreMali").ToString().Substring(0, 10);
                    txtEndDore.EditValue   = gridView1.GetFocusedRowCellValue("EndDoreMali").ToString().Substring(0, 10);
                    chkIsActive.Checked    = Convert.ToBoolean(gridView1.GetFocusedRowCellValue("DoreMaliIsActive"));
                    chkDoreIsClose.Checked = Convert.ToBoolean(gridView1.GetFocusedRowCellValue("DoreIsClose"));
                    txtMaliat.Text         = gridView1.GetFocusedRowCellValue("Maliat").ToString();
                    txtAvarez.Text         = gridView1.GetFocusedRowCellValue("Avarez").ToString();

                    txtDoreMali.ReadOnly = false;

                    MajmoeIdBeforeEdit = Convert.ToInt32(cmbMajmoehaList.EditValue);
                    VahedIdBeforeEdit  = Convert.ToInt32(cmbVahedhaList.EditValue);
                    ShobeIdBeforeEdit  = Convert.ToInt32(cmbShobeList.EditValue);
                    CodeBeforeEdit     = txtCode.Text;
                    NameBeforeEdit     = txtDoreMali.Text;
                    IsActiveBeforeEdit = chkIsActive.Checked;
                    // txtCode.ReadOnly = true;
                    cmbMajmoehaList.Focus();
                }
            }
        }