public string SaveBankCheques(BankChequesDataType _SaveData) { MySqlCommand oSqlCommand = new MySqlCommand(); string sqlQuery = "Insert Into tblcheque (" + "ChequeNo," + "BankID," + "ChOwner," + "ChType," + "ChDate," + "ReceiveRaisedDate," + "DepositDate," + "ChStatus," + "IsReconciled," + "LastUser," + "LastModiDate," + "Amount)" + " Values (" + "@ChequeNo," + "@BankID," + "@ChOwner," + "@ChType," + "@ChDate," + "@ReceiveRaisedDate," + "@DepositDate," + "@ChStatus," + "@IsReconciled," + "@LastUser," + "@LastModiDate," + "@Amount)"; try { oSqlCommand.Parameters.AddWithValue("@ChequeNo", _SaveData.ChequeNo); oSqlCommand.Parameters.AddWithValue("@BankID", _SaveData.BankID); oSqlCommand.Parameters.AddWithValue("@ChOwner", _SaveData.ChOwner); oSqlCommand.Parameters.AddWithValue("@ChType", _SaveData.ChType); oSqlCommand.Parameters.AddWithValue("@ChDate", _SaveData.ChDate); oSqlCommand.Parameters.AddWithValue("@ReceiveRaisedDate", _SaveData.ReceiveRaisedDate); oSqlCommand.Parameters.AddWithValue("@DepositDate", _SaveData.DepositDate); oSqlCommand.Parameters.AddWithValue("@ChStatus", _SaveData.ChStatus); oSqlCommand.Parameters.AddWithValue("@IsReconciled", _SaveData.IsReconciled); oSqlCommand.Parameters.AddWithValue("@LastUser", _SaveData.LastUser); oSqlCommand.Parameters.AddWithValue("@LastModiDate", _SaveData.LastModiDate); oSqlCommand.Parameters.AddWithValue("@Amount", _SaveData.Amount); string respond = Mycommon.ExicuteAnyCommandAccount(sqlQuery, oSqlCommand, "Save BankCheques"); return(respond); } catch (Exception ex) { return(ex.Message); } }
public string SaveObjectUserRoll(ObjectUserRollDataType _SaveData) { MySqlCommand oSqlCommand = new MySqlCommand(); string sqlQuery = "Insert Into tblobguserprofile (" + "RollID," + "userID," + "ObgID," + "OView," + "OSave," + "OUpdate," + "Odelete," + "OPrint," + "OPostToApp," + "OPostToAcc)" + " Values (" + "@RollID," + "@userID," + "@ObgID," + "@OView," + "@OSave," + "@OUpdate," + "@Odelete," + "@OPrint," + "@OPostToApp," + "@OPostToAcc)"; try { oSqlCommand.Parameters.AddWithValue("@RollID", _SaveData.RollID); oSqlCommand.Parameters.AddWithValue("@userID", _SaveData.userID); oSqlCommand.Parameters.AddWithValue("@ObgID", _SaveData.ObgID); oSqlCommand.Parameters.AddWithValue("@OView", _SaveData.OView); oSqlCommand.Parameters.AddWithValue("@OSave", _SaveData.OSave); oSqlCommand.Parameters.AddWithValue("@OUpdate", _SaveData.OUpdate); oSqlCommand.Parameters.AddWithValue("@Odelete", _SaveData.Odelete); oSqlCommand.Parameters.AddWithValue("@OPrint", _SaveData.OPrint); oSqlCommand.Parameters.AddWithValue("@OPostToApp", _SaveData.OPostToApp); oSqlCommand.Parameters.AddWithValue("@OPostToAcc", _SaveData.OPostToAcc); string respond = MYCommon.ExicuteAnyCommandAccount(sqlQuery, oSqlCommand, "Save ObjectUserRoll"); return(respond); } catch (Exception ex) { return(ex.Message); } }
private void CreateGrid(int RptID) { DataTable tb = new DataTable(); switch (RptID) { case 1: string AccountID = MyCommon.GetSelectedID(cmbPara3, true); dgvAccounts.ColumnCount = 8; dgvAccounts.Columns[0].Name = "Trans ID"; dgvAccounts.Columns[1].Name = "Description"; dgvAccounts.Columns[1].Width = 350; dgvAccounts.Columns[2].Name = "Main Ref"; dgvAccounts.Columns[2].Width = 100; dgvAccounts.Columns[3].Name = "Rel Ref"; dgvAccounts.Columns[4].Name = "Voucher"; dgvAccounts.Columns[5].Name = "Date"; dgvAccounts.Columns[6].Name = "Debit"; dgvAccounts.Columns[6].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; dgvAccounts.Columns[7].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; dgvAccounts.Columns[7].Name = "Credit"; tb = MyAccount.GetEachLedger(AccountID, Program.AccountStatic.CurrentAccPeriod, chkinFCur.Checked); MyCommon.LoadDatatoTableWithoutBind(dgvAccounts, tb, "Load Each ledgers"); break; case 2: dgvAccounts.ColumnCount = 8; dgvAccounts.Columns[0].Name = "Trans ID"; dgvAccounts.Columns[1].Name = "Account"; dgvAccounts.Columns[1].Width = 100; dgvAccounts.Columns[2].Name = "Account Name"; dgvAccounts.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft; dgvAccounts.Columns[2].Width = 250; dgvAccounts.Columns[3].Name = "Description"; dgvAccounts.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft; dgvAccounts.Columns[3].Width = 300; dgvAccounts.Columns[4].Name = "Date"; dgvAccounts.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft; dgvAccounts.Columns[5].Name = "Voucher"; dgvAccounts.Columns[5].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft; dgvAccounts.Columns[6].Name = "Debit"; dgvAccounts.Columns[6].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; dgvAccounts.Columns[7].Name = "Credit"; dgvAccounts.Columns[7].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; if (chkinFCur.Checked) { tb = MyAccount.GetGeneralLedger(Program.AccountStatic.CurrentAccPeriod, true, chKWithSub.Checked, dtrTo.Value); } else { tb = MyAccount.GetGeneralLedger(Program.AccountStatic.CurrentAccPeriod, false, chKWithSub.Checked, dtrTo.Value); } MyCommon.LoadDatatoTableWithoutBind(dgvAccounts, tb, "Load Each ledgers"); break; case 3: dgvAccounts.ColumnCount = 4; dgvAccounts.Columns[0].Name = "Account ID"; dgvAccounts.Columns[1].Name = "Account Name"; dgvAccounts.Columns[1].Width = 300; dgvAccounts.Columns[2].Name = "Debit"; dgvAccounts.Columns[2].Width = 100; dgvAccounts.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; dgvAccounts.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; dgvAccounts.Columns[3].Name = "Credit"; dgvAccounts.Columns[3].Width = 100; int cht = 0; if (chKWithSub.CheckState == CheckState.Checked) { cht = 1; } else { cht = 0; } tb = MyAccount.GetTrialBalance(Program.AccountStatic.CurrentAccPeriod, dtrTo.Value, cht); MyCommon.LoadDatatoTableWithoutBind(dgvAccounts, tb, "Load Trial balance"); CalTotalTrialbalanceTotal(); string delete1 = "Delete from tbltrialbalance where UseName='" + Program.AccountStatic.UserName + "'"; string respond2 = MyCommon.ExicuteAnyCommandAccount(delete1, "SAve Trial Balance"); foreach (DataRow rm in tb.Rows) { string sql1 = "Insert into tbltrialbalance values(" + Program.AccountStatic.CompanyID + ",'" + rm["AccountID"].ToString() + "','" + rm["AccountName"].ToString() + "'," + rm["FinalBalanceDr"].ToString() + "," + rm["FinalBalanceCr"].ToString() + ",'" + Program.AccountStatic.UserName + "')"; string respond = MyCommon.ExicuteAnyCommandAccount(sql1, "SAve Trial Balance"); } break; case 4: AccountID = MyCommon.GetSelectedID(cmbPara3, true); dgvAccounts.ColumnCount = 3; dgvAccounts.Columns[0].Name = "Account ID"; dgvAccounts.Columns[1].Name = "Account Name"; dgvAccounts.Columns[1].Width = 300; dgvAccounts.Columns[2].Name = "Amount"; dgvAccounts.Columns[2].Width = 100; dgvAccounts.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; tb = MyAccount.GetSupplierOutstanding(AccountID, dtrTo.Value, Program.AccountStatic.CompanyID); MyCommon.LoadDatatoTableWithoutBind(dgvAccounts, tb, "Load Supplier Outstanding"); break; default: break; } }