private void Load_Accounts() { ACVoucher clsACVoucher = new ACVoucher(); int Branch = mSys_System.pBranch_ID; if (lookBranch_ID.EditValue != null) { Branch = Convert.ToInt32(lookBranch_ID.EditValue); } DataSet ds = clsACVoucher.Load_Accounts(mSys_System.pComp_ID, Branch, mSys_System.pUser_ID); if (clsACVoucher.strErrorCode != "") { clsHomeScreen.Display_Message("MsgDBError : " + " '" + clsACVoucher.strErrorCode + "'", false); return; } DataTable dt = ds.Tables[0]; DataRow row = dt.NewRow(); row["Acc_Name"] = string.Empty; dt.Rows.InsertAt(row, 0); repositoryItemGridLookUpEdit1.DataSource = dt; repositoryItemGridLookUpEdit1.ValueMember = "Acc_Name"; repositoryItemGridLookUpEdit1.DisplayMember = "Acc_Name"; gridView1.Columns["Acc_Name"].ColumnEdit = repositoryItemGridLookUpEdit1; }
private void Fill_Accounts() { database1 clsdatabase1 = new database1(); ACVoucher clsACVoucher = new ACVoucher(); DataSet ds = new DataSet(); int VrType = -1; int Branch = mSys_System.pBranch_ID; if (lookVrType.EditValue != null) { VrType = Convert.ToInt32(lookVrType.EditValue); } if (lookBranch_ID.EditValue != null) { Branch = Convert.ToInt32(lookBranch_ID.EditValue); } ds = clsACVoucher.Fill_Accounts(mSys_System.pComp_ID, Branch, mSys_System.pUser_ID, VrType); if (clsACVoucher.strErrorCode != "") { clsHomeScreen.Display_Message("MsgDBError : " + " '" + clsdatabase1.sErrorCode + "'", false); return; } if (ds.Tables.Count > 0) { lookAcc.Properties.DataSource = ds.Tables[0]; lookAcc.Properties.DisplayMember = "Acc_Name"; lookAcc.Properties.ValueMember = "Acc_ID"; //Set_Combo(lookAcc, ds.Tables[0], "Acc_Name,", "Acc_ID", true); } }
private void Save_Authorize() { ACVoucher clsACVoucher = new ACVoucher(); int nRet_Val = 0; //if (lblAcc_SqNo.Text == "") //{ // MessageBox.Show("Please select a record to Authorize...", string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error); // return; //} ////---alert //if (MessageBox.Show(cnMsg_BeforeAuthorize_1, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) //{ // return; //} //strAuth_D = mSys_IN.pcU_M_09_C09_A; int nBranch_ID = mSys_System.pBranch_ID; int nVrType = -1; double nAmt_Total = Convert.ToDouble(gridView1.Columns["Dr"].SummaryItem.SummaryValue); if (lookBranch_ID.EditValue != null) { nBranch_ID = Convert.ToInt32(lookBranch_ID.EditValue); } if (lookVrType.EditValue != null) { nVrType = Convert.ToInt32(lookVrType.EditValue); } nRet_Val = clsACVoucher.Save_Authorize(Convert.ToInt32(lblAcc_SqNo.Text), txtTr_No.Text.Trim(), nVrType, Convert.ToDateTime(dtpTr_Date.EditValue), mSys_System.pTrLevel_Cleared, nAmt_Total, mSys_System.pComp_ID, nBranch_ID, mSys_System.pFYSDate, mSys_System.pUserName, mSys_System.pUser_ID, strAuth_D, mSys_System.pFY_ID); if (clsACVoucher.strErrorCode.Trim() != "") { clsHomeScreen.Display_Message("DB Error: " + clsACVoucher.strErrorCode + "....................", false); return; } if (nRet_Val == 1) { clsHomeScreen.Display_Message(" Your request has successfully been processed............", true); lblTrLevel.Text = mSys_System.pTrLevel_Approved.ToString(); Set_TrLevel(); Fill_Grid(); return; } else if (nRet_Val == -1) { clsHomeScreen.Display_Message(clsACVoucher.strErr_Msg, false); return; } }
private void Fill_Combo() { database1 clsdatabase1 = new database1(); ACVoucher clsACVoucher = new ACVoucher(); DataSet ds = new DataSet(); ds = clsACVoucher.Fill_Combo(mSys_System.pComp_ID, mSys_System.pUser_ID); if (clsACVoucher.strErrorCode != "") { clsHomeScreen.Display_Message("MsgDBError : " + " '" + clsdatabase1.sErrorCode + "'", false); return; } if (ds.Tables.Count > 0) { lookVrType.Properties.DataSource = ds.Tables[0]; lookVrType.Properties.DisplayMember = "VrTypeDD"; lookVrType.Properties.ValueMember = "VrType"; lookVrType_Serch.Properties.DataSource = ds.Tables[0]; lookVrType_Serch.Properties.DisplayMember = "VrTypeDD"; lookVrType_Serch.Properties.ValueMember = "VrType"; lookBranch_ID.Properties.DataSource = ds.Tables[1]; lookBranch_ID.Properties.DisplayMember = "Branch_FName"; lookBranch_ID.Properties.ValueMember = "Branch_ID"; lookBranch_Search.Properties.DataSource = ds.Tables[1]; lookBranch_Search.Properties.DisplayMember = "Branch_FName"; lookBranch_Search.Properties.ValueMember = "Branch_ID"; lookTrLevel.Properties.DataSource = ds.Tables[2]; lookTrLevel.Properties.DisplayMember = "TrLevelD"; lookTrLevel.Properties.ValueMember = "TrLevel"; //Set_Combo(lookVrType, ds.Tables[0], "VrTypeDD,", "VrType", true); //Set_Combo(lookVrType_Serch, ds.Tables[0], "VrTypeDD,", "VrType", true); //Set_Combo(lookBranch_ID, ds.Tables[1], "Branch_FName,", "Branch_ID", true); //Set_Combo(lookBranch_Search, ds.Tables[1], "Branch_FName,", "Branch_ID", true); //Set_Combo(lookTrLevel, ds.Tables[1], "TrLevelD,", "TrLevel", true); } }
private void Fill_Grid() { ACVoucher clsACVoucher = new ACVoucher(); DataSet ds_Record = new DataSet(); DataTable dt_1 = new DataTable(); int nBranch_ID = -1; int nVrType = -1; int nTrLevel = -1; object dBegDate = dtpBegDate.EditValue; object dEndDate = dtpEndDate.EditValue; if (lookBranch_Search.EditValue != null) { nBranch_ID = Convert.ToInt32(lookBranch_Search.EditValue); } if (lookTrLevel.EditValue != null) { nTrLevel = Convert.ToInt32(lookTrLevel.EditValue); } if (lookVrType_Serch.EditValue != null) { nVrType = Convert.ToInt32(lookVrType_Serch.EditValue); } database1 clsdatabase1 = new database1(); DataSet ds = new DataSet(); ds = clsACVoucher.Fill_Grid(mSys_System.pComp_ID, nBranch_ID, nVrType, nTrLevel, dBegDate, dEndDate, txtSearch.Text.Trim(), mSys_System.pUser_ID); if (clsACVoucher.strErrorCode != "") { clsHomeScreen.Display_Message("MsgDBError : " + " '" + clsACVoucher.strErrorCode + "'", false); return; } DataTable dt = ds.Tables[0]; gridControl2.DataSource = dt; }
private void Find_Record(int ID) { database1 clsdatabase1 = new database1(); ACVoucher clsACVoucher = new ACVoucher(); DataSet ds = new DataSet(); ds = clsACVoucher.Find_Record(mSys_System.pComp_ID, ID); if (clsACVoucher.strErrorCode != "") { clsHomeScreen.Display_Message("MsgDBError : " + " '" + clsACVoucher.strErrorCode + "'", false); return; } DataTable dt = ds.Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { lblAcc_SqNo.Text = dt.Rows[i]["Acc_SqNo"].ToString(); txtTr_No.Text = dt.Rows[i]["VrNo"].ToString(); dtpTr_Date.Text = dt.Rows[i]["VrDate"].ToString(); txtCheck_No.Text = dt.Rows[i]["Check_No"].ToString(); dtpCheck_Date.Text = dt.Rows[i]["Check_Date"].ToString(); lookAcc.EditValue = dt.Rows[i]["Bank_ID"]; lookVrType.EditValue = dt.Rows[i]["VrType"]; lblTrLevel.Text = dt.Rows[i]["TrLevel"].ToString(); txtRef1.Text = dt.Rows[i]["Ref1"].ToString(); txtNarration.Text = dt.Rows[i]["Ref2"].ToString(); } DataTable dt1 = ds.Tables[1]; gridControl1.DataSource = dt1; Set_TrLevel(); Tab_Main.SelectedTabPage = Tab_P1; }
private void Save_Rollback() { int nRet_Val = 0; ACVoucher clsACVoucher = new ACVoucher(); if (lblAcc_SqNo.Text == "") { MessageBox.Show("Please select a record to Rollback...", string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //---user authorizations //if (!(pUser_Auth(pcU_M_09_C03_D, 1, 1))) //{ // return; //} //---alert //if (MessageBox.Show(cnMsg_BeforeRollback, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) //{ // return; //} //strAuth_D = mSys_IN.pcU_M_09_C09_RB; int nBranch_ID = -1; int nVrType = -1; double nAmt_Total = Convert.ToDouble(gridView1.Columns["Dr"].SummaryItem.SummaryValue); if (lookBranch_ID.EditValue != null) { nBranch_ID = Convert.ToInt32(lookBranch_ID.EditValue); } if (lookVrType.EditValue != null) { nVrType = Convert.ToInt32(lookVrType.EditValue); } nRet_Val = clsACVoucher.Save_Rollback(Convert.ToInt32(lblAcc_SqNo.Text), Convert.ToInt32(lblTrLevel.Text), nVrType, mSys_System.pComp_ID, mSys_System.pBranch_ID, mSys_System.pUserName, mSys_System.pUser_ID, strAuth_D, mSys_System.pFY_ID); if (clsACVoucher.strErrorCode.Trim() != "") { clsHomeScreen.Display_Message("DB Error: " + clsACVoucher.strErrorCode + "....................", false); return; } if (nRet_Val == 0) { clsHomeScreen.Display_Message(" Your request cannot be processed...........", true); return; } if (nRet_Val == 1) { clsHomeScreen.Display_Message(" Your request has successfully been processed............", true); lblTrLevel.Text = mSys_System.pTrLevel_Pending.ToString(); Set_TrLevel(); Fill_Grid(); return; } if (nRet_Val == -1) { clsHomeScreen.Display_Message(clsACVoucher.strErr_Msg, false); return; } }
private void Save_Update(int IsUpdate) { ACVoucher clsACVoucher = new ACVoucher(); bool bln_Tr = false; bln_Tr = true; int nRet_Val = 0; //---save if (IsUpdate == 0) { //strAuth_D = mSys_Acc.pcU_M_02_C21_S; //---alert //if (MessageBox.Show(cnMsg_BeforeSave, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) //{ // return false; //} } if (IsUpdate == 1) { //strAuth_D = mSys_Acc.pcU_M_02_C21_U; ////---alert //if (MessageBox.Show(cnMsg_BeforeUpdate, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) //{ // return false; //} } DataTable dt_1 = Set_Grid(); for (int i = 0; i < gridView1.DataRowCount; i++) { DataRow row = dt_1.NewRow(); if (gridView1.GetRowCellValue(i, "Detail_ID") != null) { if (gridView1.GetRowCellValue(i, "Detail_ID").ToString() != "") { row["Detail_ID"] = gridView1.GetRowCellValue(i, "Detail_ID"); row["Sub_ID"] = gridView1.GetRowCellValue(i, "Sub_ID"); row["Narration"] = gridView1.GetRowCellValue(i, "Narration"); row["Dr"] = gridView1.GetRowCellValue(i, "Dr"); row["Cr"] = gridView1.GetRowCellValue(i, "Cr"); dt_1.Rows.Add(row); } } } List <DataRow> List_Detail = new List <DataRow>(dt_1.Select()); double nAmt_Total = Convert.ToDouble(gridView1.Columns["Dr"].SummaryItem.SummaryValue); int nVrType = -1; int nBranch_ID = mSys_System.pUser_Branch_ID; //if (cmbBranch_ID.SelectedValue != null && cmbBranch_ID.SelectedValue.ToString() != "") nBranch_ID = Convert.ToInt32(cmbBranch_ID.SelectedValue.ToString()); if (lookVrType.EditValue != null) { nVrType = Convert.ToInt32(lookVrType.EditValue); } int nBank_ID = 0; if (lookAcc.EditValue != null) { nBank_ID = Convert.ToInt32(lookAcc.EditValue); } nRet_Val = clsACVoucher.Save_Update(lblAcc_SqNo.Text.Trim(), txtTr_No.Text.Trim(), Convert.ToDateTime(dtpTr_Date.EditValue), mSys_System.pComp_ID, nVrType, nBank_ID, txtCheck_No.Text.Trim(), dtpCheck_Date.EditValue, mSys_System.pBranch_ID, nAmt_Total, txtNarration.Text.Trim(), txtRef1.Text.Trim(), List_Detail, mSys_System.pUserName, mSys_System.pUser_ID, IsUpdate, strAuth_D, mSys_System.pFY_ID); if (clsACVoucher.strErrorCode != "") { clsHomeScreen.Display_Message(clsACVoucher.strErrorCode, false); return; } if (nRet_Val == 1) { if (IsUpdate == 0) { txtTr_No.Text = clsACVoucher.Vr_No; lblAcc_SqNo.Text = clsACVoucher.Tr_SqNo.ToString(); //lblU_S.Text = mSys_System.pUserName; //lblPDate.Text = clsACVoucher.strPDate.ToString(); } lblTrLevel.Text = mSys_System.pTrLevel_Pending.ToString(); lookVrType.Enabled = false; Fill_Grid(); Set_TrLevel(); //MessageBox.Show(cnMsg_SaveUpdateComplete + "....................", string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Information); } if (nRet_Val == -1) { clsHomeScreen.Display_Message(clsACVoucher.strErr_Msg, false); return; } if (nRet_Val == 0) { //MessageBox.Show(cnMsg_ErrSaveUpdate + "....................", string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }