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 Page_Load(object sender, EventArgs e) { UCAddress1.DefaultAddressColumn(true, false, "Default", "Shipping"); if (!IsPostBack) { GetUserByID(); } this.UCToolbar1.evClickSave += pageSave; this.UCToolbar1.evClickClear += pageClear; }
private void GetUserByID() { BrilliantWMS.UserCreationService.iUserCreationClient userClient = new BrilliantWMS.UserCreationService.iUserCreationClient(); try { CustomProfile profile = CustomProfile.GetProfile(); BrilliantWMS.UserCreationService.vGetUserProfileByUserID objuser = new BrilliantWMS.UserCreationService.vGetUserProfileByUserID(); objuser = userClient.GetUserProfileByUserID(profile.Personal.UserID, profile.DBConnection._constr); lblEmpNo.Text = objuser.EmployeeID; lblUserName.Text = objuser.Title != null ? objuser.Title + " " + objuser.userName : objuser.userName; lblDepartment.Text = objuser.deptname; lblDesignation.Text = objuser.desiName; lblDOB.Text = objuser.DateOfBirth == null ? "" : Convert.ToDateTime(objuser.DateOfBirth).ToString("dd-MMM-yyyy"); lblDOJ.Text = objuser.DateOfJoining == null ? "" : Convert.ToDateTime(objuser.DateOfJoining).ToString("dd-MMM-yyyy"); txtPhone.Text = objuser.PhoneNo; txtMobile.Text = objuser.MobileNo; txtEmailID.Text = objuser.EmailID; txtOtherEmailID.Text = objuser.OtherID; txtHighestQualification.Text = objuser.HighestQualification; txtInstratedIn.Text = objuser.InterestedIn; lblReportingTo.Text = objuser.ReportingTo; if (objuser.ProfileImg != null) { Session["ProfileImg"] = objuser.ProfileImg; ImgProfile.Src = "../Image.aspx"; } else { ImgProfile.Src = "../App_Themes/Blue/img/Male.png"; if (profile.Personal.Gender != null) { if (profile.Personal.Gender != "M") { ImgProfile.Src = "../App_Themes/Blue/img/Female.png"; } } } UCAddress1.ClearAddress("User"); UCAddress1.FillAddressByObjectNameReferenceID("User", profile.Personal.UserID, "User"); } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "ProfileSetting", "GetUserByID"); } finally { userClient.Close(); } }
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) { BrilliantWMS.UserCreationService.iUserCreationClient userClient = new BrilliantWMS.UserCreationService.iUserCreationClient(); try { CustomProfile profile = CustomProfile.GetProfile(); mUserProfileHead mUserProfile = new mUserProfileHead(); mUserProfile = userClient.GetUserByID(profile.Personal.UserID, profile.DBConnection._constr); if (mUserProfile != null) { mUserProfile.MobileNo = txtMobile.Text.Trim(); mUserProfile.PhoneNo = txtPhone.Text.Trim(); mUserProfile.EmailID = txtEmailID.Text.Trim(); mUserProfile.OtherID = txtOtherEmailID.Text.Trim(); mUserProfile.HighestQualification = txtHighestQualification.Text.Trim(); mUserProfile.InterestedIn = txtInstratedIn.Text.Trim(); mUserProfile.ProfileImg = (byte[])Session["ProfileImg"]; mUserProfile.DefaultAddress = UCAddress1.BillingSeq.Trim(); mUserProfile.LastModifiedBy = profile.Personal.UserID.ToString(); mUserProfile.LastModifiedDate = DateTime.Now; userClient.UpdateUserProfile(mUserProfile, profile.DBConnection._constr); UCAddress1.FinalSaveAddress(Address.ReferenceObjectName.User, profile.Personal.UserID); profile.Personal.ProfileImg = mUserProfile.ProfileImg; profile.Save(); WebMsgBox.MsgBox.Show("Profile updated successfully"); } } catch (System.Exception ex) { Login.Profile.ErrorHandling(ex, this, "ProfileSetting", "pageSave"); } finally { userClient.Close(); } }
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 { } }