public static ACC_CUCCheck GetACC_RowStatusByRowStatusID(int RowStatusID) { ACC_CUCCheck aCC_CUCCheck = new ACC_CUCCheck(); SqlACC_CUCCheckProvider sqlACC_CUCCheckProvider = new SqlACC_CUCCheckProvider(); aCC_CUCCheck = sqlACC_CUCCheckProvider.GetACC_CUCCheckByRowStatusID(RowStatusID); return aCC_CUCCheck; }
public static ACC_CUCCheck GetACC_JournalByJournalID(int JournalID) { ACC_CUCCheck aCC_CUCCheck = new ACC_CUCCheck(); SqlACC_CUCCheckProvider sqlACC_CUCCheckProvider = new SqlACC_CUCCheckProvider(); aCC_CUCCheck = sqlACC_CUCCheckProvider.GetACC_CUCCheckByJournalID(JournalID); return aCC_CUCCheck; }
public static ACC_CUCCheck GetACC_PaytoHeadByPaytoHeadID(int PaytoHeadID) { ACC_CUCCheck aCC_CUCCheck = new ACC_CUCCheck(); SqlACC_CUCCheckProvider sqlACC_CUCCheckProvider = new SqlACC_CUCCheckProvider(); aCC_CUCCheck = sqlACC_CUCCheckProvider.GetACC_CUCCheckByPaytoHeadID(PaytoHeadID); return aCC_CUCCheck; }
public static ACC_CUCCheck GetACC_BankAccountByBankAccountID(int BankAccountID) { ACC_CUCCheck aCC_CUCCheck = new ACC_CUCCheck(); SqlACC_CUCCheckProvider sqlACC_CUCCheckProvider = new SqlACC_CUCCheckProvider(); aCC_CUCCheck = sqlACC_CUCCheckProvider.GetACC_CUCCheckByBankAccountID(BankAccountID); return aCC_CUCCheck; }
public static ACC_CUCCheck GetACC_CUCCheckByCUCCheckID(int CUCCheckID) { ACC_CUCCheck aCC_CUCCheck = new ACC_CUCCheck(); SqlACC_CUCCheckProvider sqlACC_CUCCheckProvider = new SqlACC_CUCCheckProvider(); aCC_CUCCheck = sqlACC_CUCCheckProvider.GetACC_CUCCheckByCUCCheckID(CUCCheckID); return aCC_CUCCheck; }
protected void btnUpdate_Click(object sender, EventArgs e) { ACC_CUCCheck aCC_CUCCheck = new ACC_CUCCheck (); aCC_CUCCheck.CUCCheckID= int.Parse(Request.QueryString["ID"].ToString()); aCC_CUCCheck.CUCCheckName= txtCUCCheckName.Text; aCC_CUCCheck.CUCCheckNo= txtCUCCheckNo.Text; aCC_CUCCheck.BankAccountID= int.Parse(ddlBankAccountID.SelectedValue); aCC_CUCCheck.CheckDate= DateTime.Parse(txtCheckDate.Text); aCC_CUCCheck.PaytoHeadID= int.Parse(ddlPaytoHeadID.SelectedValue); aCC_CUCCheck.JournalID= int.Parse(ddlJournalID.SelectedValue); aCC_CUCCheck.Amount= decimal.Parse(txtAmount.Text); aCC_CUCCheck.ExtraField1= txtExtraField1.Text; aCC_CUCCheck.ExtraField2= txtExtraField2.Text; aCC_CUCCheck.ExtraField3= txtExtraField3.Text; aCC_CUCCheck.ExtraField4= txtExtraField4.Text; aCC_CUCCheck.ExtraField5= txtExtraField5.Text; aCC_CUCCheck.AddedBy= Profile.card_id; aCC_CUCCheck.AddedDate= DateTime.Now; aCC_CUCCheck.UpdatedBy= Profile.card_id; aCC_CUCCheck.UpdatedDate= DateTime.Now; aCC_CUCCheck.RowStatusID= int.Parse(ddlRowStatusID.SelectedValue); bool resutl =ACC_CUCCheckManager.UpdateACC_CUCCheck(aCC_CUCCheck); Response.Redirect("AdminDisplayACC_CUCCheck.aspx"); }
public bool UpdateACC_CUCCheck(ACC_CUCCheck aCC_CUCCheck) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("UpdateACC_CUCCheck", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@CUCCheckID", SqlDbType.Int).Value = aCC_CUCCheck.CUCCheckID; cmd.Parameters.Add("@CUCCheckName", SqlDbType.NVarChar).Value = aCC_CUCCheck.CUCCheckName; cmd.Parameters.Add("@CUCCheckNo", SqlDbType.NVarChar).Value = aCC_CUCCheck.CUCCheckNo; cmd.Parameters.Add("@BankAccountID", SqlDbType.Int).Value = aCC_CUCCheck.BankAccountID; cmd.Parameters.Add("@CheckDate", SqlDbType.DateTime).Value = aCC_CUCCheck.CheckDate; cmd.Parameters.Add("@PaytoHeadID", SqlDbType.Int).Value = aCC_CUCCheck.PaytoHeadID; cmd.Parameters.Add("@JournalID", SqlDbType.Int).Value = aCC_CUCCheck.JournalID; cmd.Parameters.Add("@Amount", SqlDbType.Decimal).Value = aCC_CUCCheck.Amount; cmd.Parameters.Add("@ExtraField1", SqlDbType.NVarChar).Value = aCC_CUCCheck.ExtraField1; cmd.Parameters.Add("@ExtraField2", SqlDbType.NVarChar).Value = aCC_CUCCheck.ExtraField2; cmd.Parameters.Add("@ExtraField3", SqlDbType.NVarChar).Value = aCC_CUCCheck.ExtraField3; cmd.Parameters.Add("@ExtraField4", SqlDbType.NVarChar).Value = aCC_CUCCheck.ExtraField4; cmd.Parameters.Add("@ExtraField5", SqlDbType.NVarChar).Value = aCC_CUCCheck.ExtraField5; cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar).Value = aCC_CUCCheck.UpdatedBy; cmd.Parameters.Add("@UpdatedDate", SqlDbType.DateTime).Value = aCC_CUCCheck.UpdatedDate.AddHours(double.Parse(ConfigurationManager.AppSettings["ServerTimeDiff"].ToString())); cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = aCC_CUCCheck.RowStatusID; connection.Open(); int result = cmd.ExecuteNonQuery(); return result == 1; } }
public ACC_CUCCheck GetACC_CUCCheckFromReader(IDataReader reader) { try { ACC_CUCCheck aCC_CUCCheck = new ACC_CUCCheck ( DataAccessObject.IsNULL<int>(reader["CUCCheckID"]), DataAccessObject.IsNULL<string>(reader["CUCCheckName"]), DataAccessObject.IsNULL<string>(reader["CUCCheckNo"]), DataAccessObject.IsNULL<int>(reader["BankAccountID"]), DataAccessObject.IsNULL<DateTime>(reader["CheckDate"]), DataAccessObject.IsNULL<int>(reader["PaytoHeadID"]), DataAccessObject.IsNULL<int>(reader["JournalID"]), DataAccessObject.IsNULL<decimal>(reader["Amount"]), DataAccessObject.IsNULL<string>(reader["ExtraField1"]), DataAccessObject.IsNULL<string>(reader["ExtraField2"]), DataAccessObject.IsNULL<string>(reader["ExtraField3"]), DataAccessObject.IsNULL<string>(reader["ExtraField4"]), DataAccessObject.IsNULL<string>(reader["ExtraField5"]), DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]), DataAccessObject.IsNULL<string>(reader["UpdatedBy"].ToString()), DataAccessObject.IsNULL<DateTime>(reader["UpdatedDate"]), DataAccessObject.IsNULL<int>(reader["RowStatusID"]) ); return aCC_CUCCheck; } catch(Exception ex) { return null; } }
protected void btnSave_Click(object sender, EventArgs e) { if (decimal.Parse(hfHeadIDMoney.Value) == 0) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "Message", "alert('Please select the Account for Money entry.')", true); return; } try { List<ACC_Journal> doubleEntry = new List<ACC_Journal>(); if (Session["doubleEntry"] != null) { doubleEntry = (List<ACC_Journal>)Session["doubleEntry"]; } int journalID = 0; journalID = doubleEntry.Count; List<ACC_CUCCheck> aCC_CUCCheckList = new List<ACC_CUCCheck>(); if (Session["cucCheck"] != null) { aCC_CUCCheckList = (List<ACC_CUCCheck>)Session["cucCheck"]; } if (ddlAccountForMoney.SelectedValue == "2") { ACC_CUCCheck aCC_CUCCheck = new ACC_CUCCheck(); // aCC_CUCCheck.CUCCheckID= int.Parse(ddlCUCCheckID.SelectedValue); aCC_CUCCheck.CUCCheckName = lblHeadNameMoney.Text; aCC_CUCCheck.CUCCheckNo = txtCUCCheckNo.Text; aCC_CUCCheck.BankAccountID = int.Parse(ddlBank.SelectedValue); aCC_CUCCheck.CheckDate = DateTime.Parse(txtCUCCheckDate.Text); aCC_CUCCheck.PaytoHeadID = int.Parse(hfHeadIDMoney.Value); aCC_CUCCheck.JournalID = journalID; aCC_CUCCheck.Amount = decimal.Parse(txtAmountToPay.Text); aCC_CUCCheck.ExtraField1 = ""; aCC_CUCCheck.ExtraField2 = ""; aCC_CUCCheck.ExtraField3 = ""; aCC_CUCCheck.ExtraField4 = ""; aCC_CUCCheck.ExtraField5 = ""; aCC_CUCCheck.AddedBy = Profile.card_id; aCC_CUCCheck.AddedDate = DateTime.Now; aCC_CUCCheck.UpdatedBy = Profile.card_id; aCC_CUCCheck.UpdatedDate = DateTime.Now; aCC_CUCCheck.RowStatusID = 1;//Temporary Inserted In DB //hfCUCCheck.Value = ACC_CUCCheckManager.InsertACC_CUCCheck(aCC_CUCCheck).ToString(); aCC_CUCCheckList.Add(aCC_CUCCheck); Session["cucCheck"] = aCC_CUCCheckList; } ACC_Journal aCC_Journal = new ACC_Journal(); aCC_Journal.JournalID = doubleEntry.Count; aCC_Journal.HeadID = int.Parse(hfHeadIDMoney.Value); aCC_Journal.HeadName = lblHeadNameMoney.Text; aCC_Journal.Debit = 0; aCC_Journal.Credit = decimal.Parse(txtAmountToPay.Text); aCC_Journal.JournalMasterID = int.Parse("1"); aCC_Journal.JournalVoucherNo = "";//temporay we are using to manage the check # aCC_Journal.UserID = hfUserID.Value; aCC_Journal.AccountID = int.Parse(ddlAccountForMoney.SelectedValue); aCC_Journal.UserTypeID = int.Parse(hfUserTypeID.Value); aCC_Journal.AddedBy = Profile.card_id; aCC_Journal.AddedDate = DateTime.Now; aCC_Journal.UpdatedBy = Profile.card_id; aCC_Journal.UpdateDate = DateTime.Now; aCC_Journal.RowStatusID = 1; aCC_Journal.IsNotCheck = ddlAccountForMoney.SelectedValue == "42" ? false : true; doubleEntry.Add(aCC_Journal); Session["doubleEntry"] = doubleEntry; btnSave.Visible = false; lblPaidAmount.Text = (decimal.Parse(lblPaidAmount.Text) + decimal.Parse(txtAmountToPay.Text)).ToString("00"); txtAmountToPay.Text = "0"; loadJournal(); loadSubmitButton(); } catch (Exception ex) { } }
public static bool UpdateACC_CUCCheck(ACC_CUCCheck aCC_CUCCheck) { SqlACC_CUCCheckProvider sqlACC_CUCCheckProvider = new SqlACC_CUCCheckProvider(); return sqlACC_CUCCheckProvider.UpdateACC_CUCCheck(aCC_CUCCheck); }
public static int InsertACC_CUCCheck(ACC_CUCCheck aCC_CUCCheck) { SqlACC_CUCCheckProvider sqlACC_CUCCheckProvider = new SqlACC_CUCCheckProvider(); return sqlACC_CUCCheckProvider.InsertACC_CUCCheck(aCC_CUCCheck); }
protected void btnMoney_Click(object sender, EventArgs e) { if (ddlAccountForMoney.SelectedIndex == 0) { ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "Message", "alert('Please select the Account for Money entry.')", true); return; } try { List<ACC_Journal> doubleEntry = new List<ACC_Journal>(); if (Session["doubleEntry"] != null) { doubleEntry = (List<ACC_Journal>)Session["doubleEntry"]; } int journalID = 0; journalID = doubleEntry.Count; List<ACC_Check> checks = new List<ACC_Check>(); if (Session["checks"] != null) { checks = (List<ACC_Check>)Session["checks"]; } if (ddlAccountForMoney.SelectedValue == "42") { //If check info is given then we need to save that check ACC_Check aCC_Check = new ACC_Check(); aCC_Check.CheckID = checks.Count; aCC_Check.CheckNo = txtCheckNo.Text; aCC_Check.BankAccountNo = txtAccountNo.Text; aCC_Check.BankID = int.Parse(ddlBank.SelectedValue); aCC_Check.BranchNOtherDetails = txtBranchInfo.Text; aCC_Check.Remarks = txtAmountMoney.Text; ; aCC_Check.IsCashCheck = chkCashCheck.Checked; aCC_Check.ExtraField1 = !chkCashCheck.Checked ? ddlBankAccountID.SelectedValue : ""; aCC_Check.ExtraField2 = hfHeadIDMoney.Value; aCC_Check.ExtraField3 = ""; aCC_Check.ExtraField4 = ddlCheckFrom.SelectedValue; aCC_Check.ExtraField5 = txtCheckDate.Text; aCC_Check.AddedBy = Profile.card_id; aCC_Check.AddedDate = DateTime.Now; aCC_Check.UpdatedBy = Profile.card_id; aCC_Check.UpdateDate = DateTime.Now; aCC_Check.RowStatusID = 1;//temporary we are using this to keep info about the checks.Add(aCC_Check); Session["checks"] = checks; //hfcheckIDs.Value += ACC_CheckManager.InsertACC_Check(aCC_Check).ToString()+","; } List<ACC_CUCCheck> aCC_CUCCheckList = new List<ACC_CUCCheck>(); if (Session["cucCheck"] != null) { aCC_CUCCheckList = (List<ACC_CUCCheck>)Session["cucCheck"]; } if (ddlAccountForMoney.SelectedValue == "2" ) { ACC_CUCCheck aCC_CUCCheck = new ACC_CUCCheck(); // aCC_CUCCheck.CUCCheckID= int.Parse(ddlCUCCheckID.SelectedValue); aCC_CUCCheck.CUCCheckName = ddlAccountingUserMoney.SelectedItem.Text; aCC_CUCCheck.CUCCheckNo = ddlAccountingUserMoney.SelectedItem.Text; aCC_CUCCheck.BankAccountID = int.Parse(ddlAccountingUserMoney.SelectedValue); aCC_CUCCheck.CheckDate = DateTime.Parse(txtCUCCheckDate.Text); aCC_CUCCheck.PaytoHeadID = int.Parse(hfHeadIDMoney.Value); aCC_CUCCheck.JournalID = journalID; aCC_CUCCheck.Amount = decimal.Parse(txtAmountMoney.Text); aCC_CUCCheck.ExtraField1 = ""; aCC_CUCCheck.ExtraField2 = ""; aCC_CUCCheck.ExtraField3 = ""; aCC_CUCCheck.ExtraField4 = ""; aCC_CUCCheck.ExtraField5 = ""; aCC_CUCCheck.AddedBy = Profile.card_id; aCC_CUCCheck.AddedDate = DateTime.Now; aCC_CUCCheck.UpdatedBy = Profile.card_id; aCC_CUCCheck.UpdatedDate = DateTime.Now; aCC_CUCCheck.RowStatusID = 1;//Temporary Inserted In DB //hfCUCCheck.Value = ACC_CUCCheckManager.InsertACC_CUCCheck(aCC_CUCCheck).ToString(); aCC_CUCCheckList.Add(aCC_CUCCheck); Session["cucCheck"] = aCC_CUCCheckList; } if (txtStudentCodeMoney.Visible != false) { if (IsUser(txtStudentCodeMoney.Text)) { ACC_Journal aCC_Journal = new ACC_Journal(); aCC_Journal.JournalID = doubleEntry.Count; aCC_Journal.HeadID = int.Parse(hfHeadIDMoney.Value); aCC_Journal.HeadName = lblHeadNameMoney.Text; aCC_Journal.Debit = decimal.Parse(ddlDebitOrCredit.SelectedValue == "Cr" ? txtAmountMoney.Text : "0"); aCC_Journal.Credit = decimal.Parse(ddlDebitOrCredit.SelectedValue == "Dr" ? txtAmountMoney.Text : "0"); aCC_Journal.JournalMasterID = int.Parse("1"); aCC_Journal.JournalVoucherNo = ddlAccountForMoney.SelectedValue == "42" ? txtCheckNo.Text : ""; aCC_Journal.UserID = txtStudentCodeMoney.Text; aCC_Journal.AccountID = int.Parse(ddlAccountForMoney.SelectedValue); aCC_Journal.UserTypeID = int.Parse(ddlUserTypeIDMoney.SelectedValue); aCC_Journal.AddedBy = Profile.card_id; aCC_Journal.AddedDate = DateTime.Now; aCC_Journal.UpdatedBy = Profile.card_id; aCC_Journal.UpdateDate = DateTime.Now; aCC_Journal.RowStatusID = 1; aCC_Journal.IsNotCheck = ddlAccountForMoney.SelectedValue == "42" ? false : true; doubleEntry.Add(aCC_Journal); Session["doubleEntry"] = doubleEntry; loadJournal(); loadSubmitButton(); } else { lblUserMoney.Text = "User is not exist"; ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "Message", "alert('User is not exist')", true); } } else { ACC_Journal aCC_Journal = new ACC_Journal(); aCC_Journal.JournalID = doubleEntry.Count; aCC_Journal.HeadID = int.Parse(hfHeadIDMoney.Value); aCC_Journal.HeadName = lblHeadNameMoney.Text; aCC_Journal.Debit = decimal.Parse(ddlDebitOrCredit.SelectedValue == "Cr" ? txtAmountMoney.Text : "0"); aCC_Journal.Credit = decimal.Parse(ddlDebitOrCredit.SelectedValue == "Dr" ? txtAmountMoney.Text : "0"); aCC_Journal.JournalMasterID = int.Parse("1"); aCC_Journal.JournalVoucherNo = ddlAccountForMoney.SelectedValue == "42" ? txtCheckNo.Text : "";//temporay we are using to manage the check # aCC_Journal.UserID = ddlAccountingUserMoney.SelectedValue; aCC_Journal.AccountID = int.Parse(ddlAccountForMoney.SelectedValue); aCC_Journal.UserTypeID = int.Parse(ddlUserTypeIDMoney.SelectedValue); aCC_Journal.AddedBy = Profile.card_id; aCC_Journal.AddedDate = DateTime.Now; aCC_Journal.UpdatedBy = Profile.card_id; aCC_Journal.UpdateDate = DateTime.Now; aCC_Journal.RowStatusID = 1; aCC_Journal.IsNotCheck = ddlAccountForMoney.SelectedValue == "42" ? false : true; doubleEntry.Add(aCC_Journal); Session["doubleEntry"] = doubleEntry; loadJournal(); loadSubmitButton(); } ClearAllControllMoney(); } catch (Exception ex) { } }
private void showACC_CUCCheckData() { ACC_CUCCheck aCC_CUCCheck = new ACC_CUCCheck (); aCC_CUCCheck = ACC_CUCCheckManager.GetACC_CUCCheckByCUCCheckID(Int32.Parse(Request.QueryString["ID"])); txtCUCCheckName.Text =aCC_CUCCheck.CUCCheckName.ToString(); txtCUCCheckNo.Text =aCC_CUCCheck.CUCCheckNo.ToString(); ddlBankAccountID.SelectedValue =aCC_CUCCheck.BankAccountID.ToString(); txtCheckDate.Text =aCC_CUCCheck.CheckDate.ToString(); ddlPaytoHeadID.SelectedValue =aCC_CUCCheck.PaytoHeadID.ToString(); ddlJournalID.SelectedValue =aCC_CUCCheck.JournalID.ToString(); txtAmount.Text =aCC_CUCCheck.Amount.ToString(); txtExtraField1.Text =aCC_CUCCheck.ExtraField1.ToString(); txtExtraField2.Text =aCC_CUCCheck.ExtraField2.ToString(); txtExtraField3.Text =aCC_CUCCheck.ExtraField3.ToString(); txtExtraField4.Text =aCC_CUCCheck.ExtraField4.ToString(); txtExtraField5.Text =aCC_CUCCheck.ExtraField5.ToString(); ddlRowStatusID.SelectedValue =aCC_CUCCheck.RowStatusID.ToString(); }