private void JRequestArchiveFileForm_Load(object sender, EventArgs e) { try { if (State == JFormState.Update) { Set_Form(); } else { jdgRequestList.Columns.Clear(); lblRequester.Text = JMainFrame.BaseCurrentPostTitle; _ArchiveList = JRequestArchiveFile.GetDataTableArchiveFile(_ArchiveCode, 0); jdgRequestList.DataSource = _ArchiveList; txtRequestDate.Date = JDateTime.Now(); } jdgRequestList.Columns["Code"].Visible = false; jdgRequestList.Columns["RequestCode"].Visible = false; jdgRequestList.Columns["ArchiveCode"].Visible = false; jdgRequestList.Columns["Confirm_Post_Code"].Visible = false; jdgRequestList.Columns["Confirm_User_Code"].Visible = false; jdgRequestList.Columns["status"].Visible = false; jdgRequestList.Columns["Status"].ReadOnly = true; jdgRequestList.Columns["RegisterDate"].ReadOnly = true; jdgRequestList.Columns["Subject"].ReadOnly = true; jdgRequestList.Columns["ArchiveFileDesc"].ReadOnly = true; jdgRequestList.Columns["Confirm_Full_Title"].ReadOnly = true; } catch (Exception ex) { JSystem.Except.AddException(ex); } }
private void Set_Form() { try { JRequestArchiveFile tmpRequestArchiveFile = new JRequestArchiveFile(_Code); lblRequester.Text = tmpRequestArchiveFile.Requester_Full_Title; txtRequestDate.Date = tmpRequestArchiveFile.RequestDate; //_Status = tmpRequestArchiveFile.Status; groupBox2.Enabled = true; if (JRequestArchiveFile.CheckConfirm(tmpRequestArchiveFile.Requester_Post_Code)) //&& _Status == ClassLibrary.Domains.Employment.JVacationStatus.Request) { //gbConfirm.Enabled = true; _NextStatus = ClassLibrary.Domains.Employment.JVacationStatus.Confirm; //btnBack.Visible = true; DataGridViewComboBoxColumn comboboxColumn; comboboxColumn = CreateComboBoxColumn(); comboboxColumn.DataSource = ClassLibrary.Domains.JGlobal.JStatusArchive.GetData(); comboboxColumn.DisplayMember = "FarsiName"; comboboxColumn.ValueMember = "Value"; //comboboxColumn.Name = "Status"; jdgRequestList.Columns.Insert(0, comboboxColumn); btnSave.Text = "تایید"; //_ArchiveList = JRequestArchiveFile.GetDataTableArchiveFile(0, _Code); //jdgRequestList.DataSource = _ArchiveList; string[] row0 = { "", "", "", "", "", "", "", "", "", "", "", "", "" }; int count = 0; foreach (DataRow dr in JRequestArchiveFile.GetDataTableArchiveFile(0, _Code).Rows) { row0[0] = dr["Status"].ToString(); row0[1] = dr["RegisterDate"].ToString(); row0[2] = dr["Subject"].ToString(); row0[3] = dr["ArchiveFileDesc"].ToString(); row0[4] = dr["Code"].ToString(); row0[5] = dr["RequestCode"].ToString(); row0[6] = dr["Confirm_Post_Code"].ToString(); row0[7] = dr["Confirm_Full_Title"].ToString(); row0[8] = dr["Confirm_User_Code"].ToString(); row0[9] = dr["StartDate"].ToString(); row0[10] = dr["EndDate"].ToString(); row0[11] = dr["Description"].ToString(); row0[12] = dr["ArchiveCode"].ToString(); jdgRequestList.Rows.Add(row0); //jdgRequestList.Rows[count].Cells[0].Value = Convert.ToInt32(dr["Status"].ToString()); count++; } //_ArchiveList = jdgRequestList.DataSource; } else { btnSave.Enabled = false; jdgRequestList.Columns.Clear(); _ArchiveList = JRequestArchiveFile.GetDataTableArchiveFile(0, _Code); jdgRequestList.DataSource = _ArchiveList; } //if (tmpRequestArchiveFile.CheckConfirmFinal(_Refer_Code) && _Status == ClassLibrary.Domains.Employment.JVacationStatus.Confirm) //{ // gbConfirm.Enabled = true; // _NextStatus = ClassLibrary.Domains.Employment.JVacationStatus.Personnel; // btnBack.Visible = true; //} //if (_Status == ClassLibrary.Domains.Employment.JVacationStatus.NotConfirm) // lblStatus.Text = "وضعیت " + " عدم تایید "; if ((_Status == ClassLibrary.Domains.Employment.JVacationStatus.Request) || (_Status == 0)) { //lblStatus.Text = "وضعیت " + " درخواست "; if ((tmpRequestArchiveFile.Requester_Post_Code == JMainFrame.CurrentPostCode) && (_Refer_Code > 0)) { Automation.JARefer tmpRefer = new Automation.JARefer(_Refer_Code); if (tmpRefer.receiver_post_code == JMainFrame.CurrentPostCode) { groupBox2.Enabled = true; btnSave.Enabled = true; } else { btnSave.Enabled = false; } } else { //if (gbConfirm.Enabled == false) // btnSave.Enabled = false; //btnSave.Text = "تایید"; } } else if (_Status == ClassLibrary.Domains.Employment.JVacationStatus.Confirm) { //lblStatus.Text = "وضعیت " + " تایید "; btnSave.Text = "تایید"; //if (gbConfirm.Enabled == false) // btnSave.Enabled = false; } //else if (_Status == ClassLibrary.Domains.Employment.JVacationStatus.Personnel) //{ // lblStatus.Text = "وضعیت " + " تایید کارگزینی "; // btnSave.Text = "تایید"; // btnSave.Enabled = false; // gbConfirm.Enabled = false; //} else if (_Status == ClassLibrary.Domains.Employment.JVacationStatus.NotConfirm) { //rbNoConfirm.Checked = true; btnSave.Enabled = false; } else if (_Status == 0) { groupBox2.Enabled = true; btnSave.Enabled = true; } //juC_ReferHistory.SetData(_Code, ClassLibrary.Domains.JAutomation.JObjectType.ArchiveRequest); //juC_ReferHistory.ReferGroup = new int[] { 1, 2, 3 }; } catch (Exception ex) { //Except.AddException(ex); } }