protected void ResetUserControl() { try { CustomProfile profile = CustomProfile.GetProfile(); /*Set Values to UC_AddressInformation1*/ UCAddress1.ClearAddress("Warehouse"); /*Set Values to UC_ContactPerson1*/ UCContactPerson1.ClearContactPerson("Warehouse"); /*Set Values to UC_Document*/ // UC_AttachDocument1.ClearDocument("Customer"); /*Set Values to UC_StatutoryDetails1*/ // UC_StatutoryDetails1.BindGridStatutoryDetails(0, "Customer", profile.Personal.CompanyID); } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "Warehouse Master", "ResetUserControl"); } finally { } }
protected void FillUserControl(long resultId) { try { CustomProfile profile = CustomProfile.GetProfile(); // UCAddress1.FillAddressByObjectNameReferenceID("Account", resultId, ""); // UCContactPerson1.FillContactPersonByObjectNameReferenceID("Contact", resultId, ""); UCContactPerson1.FillContactPersonByObjectNameReferenceID("Warehouse", resultId, "Warehouse"); // UC_StatutoryDetails1.BindGridStatutoryDetails(resultId, "Customer", profile.Personal.CompanyID); // UC_AttachDocument1.FillDocumentByObjectNameReferenceID(resultId, "Customer", "Customer"); } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "Customer Master", "FillUserControl"); } finally { } }
protected void FillUserControl(long resultId) { try { CustomProfile profile = CustomProfile.GetProfile(); UCAddress1.FillAddressByObjectNameReferenceID("Vendor", resultId, "Vendor"); UCContactPerson1.FillContactPersonByObjectNameReferenceID("Vendor", resultId, "Vendor"); UC_AttachDocument1.FillDocumentByObjectNameReferenceID(Convert.ToInt64(resultId), "Vendor", "Vendor"); //UCPaymentDetail1.FillOutstandingGrid(resultId.ToString()); } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "Vendor Master", "FillUserControl"); } finally { } }
protected void FillUserControl(long resultId) { try { CustomProfile profile = CustomProfile.GetProfile(); UCAddress1.FillAddressByObjectNameReferenceID("Client", resultId, "Client"); UCContactPerson1.FillContactPersonByObjectNameReferenceID("Client", resultId, "Client"); UC_AttachDocument1.FillDocumentByObjectNameReferenceID(Convert.ToInt64(resultId), "Client", "Client"); /* UC_StatutoryDetails1.BindGridStatutoryDetails(Convert.ToInt64(resultId), "Customer", profile.Personal.CompanyID);*/ // UCPaymentDetail1.FillOutstandingGrid(resultId.ToString()); // Coomented in BrilliantWMS to check first } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "Client Master", "FillUserControl"); } finally { } }
protected void pageSave(Object sender, BrilliantWMS.ToolbarService.iUCToolbarClient e) { CustomProfile profile = CustomProfile.GetProfile(); iWarehouseClient Warehouseclient = new iWarehouseClient(); mWarehouseMaster WHDetail = new mWarehouseMaster(); tAddress address = new tAddress(); if (hdnstate.Value == "Edit") { WHDetail = Warehouseclient.GetWarehouseMasterByID(long.Parse(hdnwarehouseID.Value), profile.DBConnection._constr); address = Warehouseclient.GetWarehouseAddress(long.Parse(hdnwarehouseID.Value), profile.DBConnection._constr); } WHDetail.Code = txtcode.Text.ToString(); WHDetail.WarehouseName = txtwarehousename.Text.ToString(); WHDetail.Type = ddltype.SelectedItem.Text; WHDetail.Description = txtdescription.Text.ToString(); WHDetail.Remark = txtremark.Text.ToString(); WHDetail.Active = "No"; if (rbtYes.Checked == true) { WHDetail.Active = "Yes"; } WHDetail.CompanyID = long.Parse(hdncompanyid.Value); if (hdncustomerid.Value != "") { WHDetail.CustomerID = long.Parse(hdncustomerid.Value); } else { WHDetail.CustomerID = long.Parse(hdnNewCustomerID.Value); } WHDetail.CreatedBy = profile.Personal.UserID; WHDetail.CreationDate = DateTime.Now; address.AddressLine1 = txtCAddress1.Text.ToString(); address.AddressLine2 = txtAddress2.Text.ToString(); address.Zipcode = txtZipCode.Text.ToString(); address.County = hdnCountry.Value; address.State = hdncountryState.Value; address.City = txtCity.Text.ToString(); address.ObjectName = "Warehouse"; address.Active = "Y"; address.CreatedBy = profile.Personal.UserID.ToString(); address.CreationDate = DateTime.Now; address.CompanyID = long.Parse(hdncompanyid.Value); address.AddressType = "Warehouse"; if (hdnstate.Value == "Edit") { WHDetail.ModifiedBy = profile.Personal.UserID; WHDetail.ModifiedDate = DateTime.Now; address.LastModifiedBy = profile.Personal.UserID.ToString(); address.LastModifiedDate = DateTime.Now; long WarehouseID = Warehouseclient.SaveWarehouseMaster(WHDetail, profile.DBConnection._constr); address.ReferenceID = WarehouseID; long AddressID = Warehouseclient.SaveWarehouseAddress(address, profile.DBConnection._constr); UCContactPerson1.FinalSaveContactPerson("Warehouse", long.Parse(hdnwarehouseID.Value)); UCContactPerson1.ClearContactPerson("Warehouse"); WebMsgBox.MsgBox.Show("Record Updated successfully"); } else { long WarehouseID = Warehouseclient.SaveWarehouseMaster(WHDetail, profile.DBConnection._constr); address.ReferenceID = WarehouseID; hdnwarehouseID.Value = WarehouseID.ToString(); long AddressID = Warehouseclient.SaveWarehouseAddress(address, profile.DBConnection._constr); UCContactPerson1.FinalSaveContactPerson("Warehouse", long.Parse(hdnwarehouseID.Value)); UCContactPerson1.ClearContactPerson("Warehouse"); WebMsgBox.MsgBox.Show("Record saved successfully"); } clear(); Response.Redirect("WarehouseMaster.aspx"); }
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 { } }