protected void GetVendorOpeningBal() { CustomProfile profile = CustomProfile.GetProfile(); iCustomerClient ServiceAccountMaster = new iCustomerClient(); try { tOpeningBalance objTOpeningBal = new tOpeningBalance(); objTOpeningBal = ServiceAccountMaster.GetTOpeningBalanceDtls(Convert.ToInt64(HdnAccountId.Value), "Client", profile.DBConnection._constr); txt_OpeningBalance.Text = objTOpeningBal.OpeningBalance.ToString(); if (objTOpeningBal.FinancialYear != null) { ddl_FinancialYr.SelectedValue = objTOpeningBal.FinancialYear.ToString(); } if (objTOpeningBal.DrCr != null) { ddl_DrCr.SelectedValue = objTOpeningBal.DrCr.ToString(); } HdnOpeningBalId.Value = objTOpeningBal.ID.ToString(); } catch (Exception ex) { Login.Profile.ErrorHandling(ex, this, "Client Master", "GetVendorOpeningBal"); } finally { ServiceAccountMaster.Close(); } }
protected void GetVendorOpeningBal() { CustomProfile profile = CustomProfile.GetProfile(); iCustomerClient ServiceAccountMaster = new iCustomerClient(); tOpeningBalance objTOpeningBal = new tOpeningBalance(); objTOpeningBal = ServiceAccountMaster.GetTOpeningBalanceDtls(Convert.ToInt64(HdnAccountId.Value), "Vendor", profile.DBConnection._constr); txt_OpeningBalance.Text = objTOpeningBal.OpeningBalance.ToString(); if (objTOpeningBal.FinancialYear != null) { ddl_FinancialYr.SelectedValue = objTOpeningBal.FinancialYear.ToString(); } if (objTOpeningBal.DrCr != null) { ddl_DrCr.SelectedValue = objTOpeningBal.DrCr.ToString(); } HdnOpeningBalId.Value = objTOpeningBal.ID.ToString(); }
protected void pageSave(Object sender, ToolbarService.iUCToolbarClient e) { try { CustomProfile profile = CustomProfile.GetProfile(); iCustomerClient ServiceAccountMaster = new iCustomerClient(); mVendor Objvendor = new mVendor(); tCustomerHead objCutomerHead = new tCustomerHead(); tOpeningBalance objOpeningBal = new tOpeningBalance(); int result; long Result1; if (checkDuplicate() == "") { if (HdnAccountId.Value != "" && HdnAccountId.Value != "0") { //objCutomerHead = ServiceAccountMaster.GetCustomerHeadDetailByCustomerID(Convert.ToInt64(HdnAccountId.Value), profile.DBConnection._constr); Objvendor = ServiceAccountMaster.GetVendorDetailByVendorID(Convert.ToInt64(HdnAccountId.Value), profile.DBConnection._constr); objOpeningBal = ServiceAccountMaster.GetTOpeningBalanceDtls(Convert.ToInt64(HdnAccountId.Value), "Vendor", profile.DBConnection._constr); objCutomerHead.LastModifiedBy = profile.Personal.UserID.ToString(); objCutomerHead.LastModifiedDate = DateTime.Now; } else { objCutomerHead.CreatedBy = profile.Personal.UserID.ToString(); objCutomerHead.CreationDate = DateTime.Now; } Objvendor.Name = txt_custname.Text; Objvendor.CompanyID = long.Parse(ddlcompany.SelectedItem.Value); Objvendor.Code = txt_custcode.Text; Objvendor.Sector = Convert.ToInt64(Ddl_Sector.SelectedItem.Value); Objvendor.VCType = Convert.ToInt64(ddlvendortype.SelectedItem.Value); Objvendor.Creditdays = Convert.ToInt64(txt_CreditDays.Text); Objvendor.TurnOver = decimal.Parse(txt_turnOver.Text); Objvendor.CompType = Convert.ToInt64(Ddl_CompanyType.SelectedItem.Value); if (rbtnYes.Checked == true) { Objvendor.Active = "Y"; } if (rbtnNo.Checked == true) { Objvendor.Active = "N"; } Objvendor.CustomerID = long.Parse(hdncustomerid.Value); Objvendor.Website = TxtWebsite.Text; Objvendor.AccountType = "Vendor"; /* if (Ddl_CompanyType.SelectedIndex > 0) objCutomerHead.CustomerTypeID = Convert.ToInt64(Ddl_CompanyType.SelectedItem.Value); * * objCutomerHead.CustomerCode = null; * if (txt_custcode.Text.ToString().Trim() != "") objCutomerHead.CustomerCode = (txt_custcode.Text).ToString(); * * if (Ddl_Sector.SelectedIndex > 0) objCutomerHead.SectorID = Convert.ToInt64(Ddl_Sector.SelectedItem.Value); * * objCutomerHead.Name = null; * if (txt_custname.Text.ToString().Trim() != "") objCutomerHead.Name = (txt_custname.Text).ToString(); * * objCutomerHead.WebSite = null; * if (TxtWebsite.Text.ToString().Trim() != "") objCutomerHead.WebSite = (TxtWebsite.Text).ToString(); * * objCutomerHead.TurnOver = null; * if (txt_turnOver.Text.ToString().Trim() != "") objCutomerHead.TurnOver = (txt_turnOver.Text).ToString(); * * * objCutomerHead.CreditDays = null; * if (txt_CreditDays.Text.ToString().Trim() != "") objCutomerHead.CreditDays = Convert.ToInt32(txt_CreditDays.Text); * * if (rbtnYes.Checked == true) objCutomerHead.Active = "Y"; * if (rbtnNo.Checked == true) objCutomerHead.Active = "N"; * * objCutomerHead.BillingAddressID = Convert.ToInt64(UCAddress1.BillingSeq); * objCutomerHead.ShippingAddressID = Convert.ToInt64(UCAddress1.ShippingSeq); * * objCutomerHead.ConperID = UCContactPerson1.ContactPersonIDs;*/ objOpeningBal.FinancialYear = null; if (ddl_FinancialYr.SelectedIndex > 0) { objOpeningBal.FinancialYear = ddl_FinancialYr.SelectedValue; } objOpeningBal.ObjectName = "Vendor"; objOpeningBal.OpeningBalance = null; if (txt_OpeningBalance.Text.ToString().Trim() != "") { objOpeningBal.OpeningBalance = Convert.ToDecimal((txt_OpeningBalance.Text).ToString()); } objOpeningBal.DrCr = null; if (ddl_DrCr.SelectedIndex > 0) { objOpeningBal.DrCr = ddl_DrCr.SelectedValue; } //objOpeningBal.ID = Convert.ToInt64(HdnOpeningBalId.Value.ToString()); if (HdnAccountId.Value == string.Empty) { //objCutomerHead.CreatedBy = profile.Personal.UserID.ToString(); //objCutomerHead.CreationDate = DateTime.Now; //objCutomerHead.CompanyID = profile.Personal.CompanyID; Objvendor.CreatedBy = profile.Personal.UserID.ToString(); Objvendor.CreationDate = DateTime.Now; // result = ServiceAccountMaster.SaveCustomerDetails(objCutomerHead, "AddNew", profile.DBConnection._constr); result = ServiceAccountMaster.SaveVendorDetails(Objvendor, "AddNew", profile.DBConnection._constr); } else { //objCutomerHead.LastModifiedBy = profile.Personal.UserID.ToString(); //objCutomerHead.LastModifiedDate = DateTime.Now; Objvendor.LastModifiedBy = profile.Personal.UserID.ToString(); Objvendor.LastModifiedDate = DateTime.Now; //result = ServiceAccountMaster.SaveCustomerDetails(objCutomerHead, "Edit", profile.DBConnection._constr); result = ServiceAccountMaster.SaveVendorDetails(Objvendor, "Edit", profile.DBConnection._constr); } objOpeningBal.ReferenceID = result; HdnAccountId.Value = result.ToString(); if (HdnOpeningBalId.Value == "0" || HdnOpeningBalId.Value == "") { objOpeningBal.CreatedBy = profile.Personal.UserID.ToString(); objOpeningBal.CreatedDate = DateTime.Now; // Result1 = ServiceAccountMaster.SaveOpeningBalance(objOpeningBal, "AddNew", profile.DBConnection._constr); Result1 = ServiceAccountMaster.SaveAccountOpeningBal(objOpeningBal, profile.DBConnection._constr); } else { objOpeningBal.LastModifiedBy = profile.Personal.UserID.ToString(); objOpeningBal.LastModifiedDate = DateTime.Now; // Result1 = ServiceAccountMaster.SaveOpeningBalance(objOpeningBal, "Edit", profile.DBConnection._constr); Result1 = ServiceAccountMaster.SaveAccountOpeningBal(objOpeningBal, profile.DBConnection._constr); } HdnOpeningBalId.Value = Result1.ToString(); UCAddress1.FinalSaveAddress(Address.ReferenceObjectName.Vendor, result); UCContactPerson1.FinalSaveContactPerson("Vendor", result); UC_AttachDocument1.FinalSaveDocument(result); /* UC_StatutoryDetails1.FinalSaveToStatutoryDetails(Convert.ToInt64(result), "Customer", profile.Personal.CompanyID);*/ if (result != 0) { WebMsgBox.MsgBox.Show("Record saved successfully"); } clr(); MainCustomerGridBind(); // FillUserControl(result); ActiveTab("Load"); } } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "Account Master", "pageSave"); } finally { } }