protected void imgBtnSubmit_Click(object sender, ImageClickEventArgs e) { var otherDal = new OtherDAL(); EOrderShippingInformation objShippingInfo = new EOrderShippingInformation(); EZip objzip = otherDal.CheckCityZip(txtCity.Text, txtZip.Text, ddlstate.SelectedItem.Value); if (objzip.CityID == 0) { ClientScript.RegisterStartupScript(typeof(string), "JSCode_CityValidation", "alert('City Name entered is not correct.'); ", true); return; } else if (objzip.ZipID == 0) { ClientScript.RegisterStartupScript(typeof(string), "JSCode_ZipValidation", "alert('Zip Code entered is not correct.'); ", true); return; } objShippingInfo.OrderShippingInformationID = Convert.ToInt32(Request.QueryString["OrderShippingInformationID"].ToString()); objShippingInfo.Carrier = Convert.ToInt32(ddlcarrier.SelectedValue); objShippingInfo.CarrierTransactionNumber = txtcarriertno.Text; objShippingInfo.ShippingDate = Convert.ToDateTime(txtShippingDate.Text).ToString(); objShippingInfo.ShippingNotes = txtShippingNotes.Text; objShippingInfo.ShippingAddressID = Convert.ToInt32(hfAddressID.Value); objShippingInfo.TrackingNumber = txtTrackingNo.Text; objShippingInfo.ShippingAddress = new EAddress(); objShippingInfo.ShippingAddress.AddressID = Convert.ToInt32(hfAddressID.Value); objShippingInfo.ShippingAddress.Address1 = txtAddress1.Text; objShippingInfo.ShippingAddress.Address2 = txtAddress2.Text; objShippingInfo.ShippingAddress.StateID = Convert.ToInt32(ddlstate.SelectedValue); objShippingInfo.ShippingAddress.CityID = objzip.CityID; objShippingInfo.ShippingAddress.ZipID = objzip.ZipID; objShippingInfo.LastModifiedBy = Convert.ToInt32(IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationRoleUserId); objShippingInfo.LastModifiedByRole = Convert.ToInt32(IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.RoleId); Int64 returnresult = otherDal.UpdateShippingInfo(objShippingInfo); if (returnresult > 0) { ClientScript.RegisterStartupScript(typeof(string), "jscode_savesuccessful", "parent.parent.GB_hide(); ", true); } else { ClientScript.RegisterStartupScript(typeof(string), "jscode_saveerror", "alert('Shipping Information not saved successfully.'); ", true); } }
public bool DoesRetrievedZipCorrespondToCity(string city, string zipCode, string state, out EZip zipEntity, out string errorMessage) { var otherDAL = new OtherDAL(); zipEntity = otherDAL.CheckCityZip(city, zipCode, state); int cityId = zipEntity.CityID; int zipId = zipEntity.ZipID; if (cityId == 0) { errorMessage = "City name is not valid. Please Try again."; return(false); } if (cityId > 0 && zipId == 0) { errorMessage = "Zip entered for Address is not valid for the corresponding city. Please Try again."; return(false); } errorMessage = string.Empty; return(true); }
private void SaveFranchisor() { OtherDAL otherDal = new OtherDAL(); EZip objczip; objczip = otherDal.CheckCityZip(txtCity.Text, txtzip1.Text, ddlState.SelectedValue); if (objczip.CityID == 0) { ClientScript.RegisterStartupScript(typeof(string), "bujscode", "alert('City name entered for contact address is not valid.');", true); return; } else if (objczip.CityID > 0 && objczip.ZipID == 0) { ClientScript.RegisterStartupScript(typeof(string), "bujscode", "alert('Zip Code entered for contact address, corresponding to its city name, is not valid.');", true); return; } EFranchisorUser franchisoruser = new EFranchisorUser(); var address = new Falcon.Entity.Other.EAddress(); var user = new Falcon.Entity.Other.EUser(); // format phone no. CommonCode objCommonCode = new CommonCode(); franchisoruser.Active = true; address.Address1 = txtaddress1.Text; address.Address2 = txtAddress2.Text; address.CityID = objczip.CityID; address.StateID = Convert.ToInt32(ddlState.SelectedValue); address.CountryID = Convert.ToInt32(hfCountryID.Value); address.ZipID = objczip.ZipID; user.FirstName = txtfname.Text; user.MiddleName = txtMiddleName.Text; user.LastName = txtlname.Text; user.SSN = txtSSN.Text; user.DOB = Convert.ToDateTime(txtDOB.Text).ToString(); user.PhoneHome = objCommonCode.FormatPhoneNumber(txtphonehome.Text); user.PhoneOffice = objCommonCode.FormatPhoneNumber(txtphoneother.Text); user.PhoneCell = objCommonCode.FormatPhoneNumber(txtphonecell.Text); user.EMail1 = txtEmail1.Text; user.EMail2 = txtEmail2.Text; franchisoruser.User = user; franchisoruser.Address = address; Int64 returnresult; var currentSession = IoC.Resolve <ISessionContext>().UserSession; franchisoruser.ShellDescription = txtabtmself.Text; FranchisorDAL franchisorDAL = new FranchisorDAL(); if (ViewState["IsEdit"].ToString() != string.Empty) { franchisoruser.User.UserID = Convert.ToInt32(currentSession.UserId); returnresult = franchisorDAL.SaveFranchisorUser(franchisoruser, Convert.ToInt32(EOperationMode.Update), currentSession.CurrentOrganizationRole.OrganizationId.ToString()); if (returnresult == 0) { returnresult = 9999991; } if (txtPassword.Text.Length > 0) { var userLoginService = IoC.Resolve <IUserLoginService>(); userLoginService.ResetPassword(Convert.ToInt32(currentSession.UserId), txtPassword.Text, false, currentSession.CurrentOrganizationRole.OrganizationRoleUserId, false); } Response.RedirectUser(ResolveUrl("~/App/Franchisor/ProfilePage.aspx")); } else { returnresult = franchisorDAL.SaveFranchisorUser(franchisoruser, Convert.ToInt32(EOperationMode.Insert), currentSession.CurrentOrganizationRole.OrganizationId.ToString()); if (returnresult == 0) { returnresult = 9999990; } } }
/// <summary> /// Save Prospect /// </summary> private void SaveProspect() { //FranchisorService service = new FranchisorService(); EProspect prospect = new EProspect(); EAddress addressbilling = new EAddress(); EAddress addressmailing = new EAddress(); EProspectDetails objEProspectDetails = new EProspectDetails(); prospect.ProspectDetails = new EProspectDetails(); bool blnIsHost = false; OtherDAL otherDal = new OtherDAL(); EZip zipobjbilling = otherDal.CheckCityZip(txtcityBilling.Text, txtzipBilling.Text, ddlstateBilling.SelectedValue); EZip zipobjmailing = new EZip(); // format phone no. CommonCode objCommonCode = new CommonCode(); if (txtzipBilling.Text != "") { if (zipobjbilling.CityID == 0) { divErrorMsg.Visible = true; divErrorMsg.InnerHtml = "City name for address is not valid. <br> Please Try again."; //ClientScript.RegisterStartupScript(typeof(string), "jscodebilling", "alert('City name for billing address is not valid. <br> Please Try again.');", true); return; } else if (zipobjbilling.CityID > 0 && zipobjbilling.ZipID == 0) { divErrorMsg.Visible = true; divErrorMsg.InnerHtml = "Address Zip code for the corresponding city is not valid. <br> Please Try again."; //ClientScript.RegisterStartupScript(typeof(string), "jscodebilling", "alert('Billing address Zip code for the corresponding city is not valid. <br> Please Try again.');", true); return; } } if (chkMailingAddress.Checked == true) { zipobjmailing = otherDal.CheckCityZip(txtcityMailing.Text, txtzipMailing.Text, ddlstateMailing.SelectedValue); if (txtzipMailing.Text != "") { if (zipobjmailing.CityID == 0) { divErrorMsg.Visible = true; divErrorMsg.InnerHtml = "City name for mailing address is not valid. <br> Please Try again."; //ClientScript.RegisterStartupScript(typeof(string), "jscodemailing", "alert('City name for mailing address is not valid. <br> Please Try again.');", true); return; } else if (zipobjmailing.CityID > 0 && zipobjmailing.ZipID == 0) { divErrorMsg.Visible = true; divErrorMsg.InnerHtml = "Mailing address Zip code for the corresponding city is not valid. <br> Please Try again."; //ClientScript.RegisterStartupScript(typeof(string), "jscodemailing", "alert('Mailing address Zip code for the corresponding city is not valid. <br> Please Try again.');", true); return; } } } if (ViewState["ProspectID"] != null) { prospect.ProspectID = Convert.ToInt32(ViewState["ProspectID"].ToString()); } if (ViewState["AddressIDBilling"] != null) { addressbilling.AddressID = Convert.ToInt32(ViewState["AddressIDBilling"].ToString()); } prospect.OrganizationName = txtOrgName.Text; prospect.WebSite = txtwebaddress.Text; EProspectType prospecttype = new EProspectType(); prospecttype.ProspectTypeID = Convert.ToInt32(ddlHostType.SelectedValue.ToString()); prospect.ProspectType = prospecttype; prospect.ActualMembership = txtActualMembers.Text.Length > 0 ? Convert.ToDecimal(txtActualMembers.Text) : 0; prospect.Attendance = txtAttendence.Text.Length > 0 ? Convert.ToDecimal(txtAttendence.Text) : 0; prospect.EMailID = txtEmail.Text; prospect.PhoneCell = ""; if (txtcphoneoffice.Text.Trim().Equals("(___)-___-____")) { txtcphoneoffice.Text = ""; } prospect.PhoneOffice = objCommonCode.FormatPhoneNumber(txtcphoneoffice.Text); prospect.PhoneOther = ""; prospect.Notes = txtNotes.Text; if (ViewState["IsHost"].ToString().Equals("1")) { prospect.IsHost = true; blnIsHost = true; } else { prospect.IsHost = false; } addressbilling.Address1 = txtaddress1Billing.Text; addressbilling.Address2 = txtaddress2Billing.Text; if (Convert.ToInt32(ddlstateBilling.SelectedValue) > 0) { addressbilling.State = ddlstateBilling.SelectedItem.Text; addressbilling.StateID = Convert.ToInt32(ddlstateBilling.SelectedItem.Value); } else { addressbilling.State = string.Empty; } addressbilling.ZipID = txtzipBilling.Text.Length > 0 ? Convert.ToInt32(txtzipBilling.Text) : 0; addressbilling.City = txtcityBilling.Text; if (txtFax.Text.Trim().Equals("(___)-___-____")) { txtFax.Text = ""; } addressbilling.Fax = objCommonCode.FormatPhoneNumber(txtFax.Text); prospect.Address = addressbilling; if (blnIsHost) { addressbilling.ZipID = txtzipBilling.Text.Length > 0 ? zipobjbilling.ZipID : 0; } else { addressbilling.ZipID = txtzipBilling.Text.Length > 0 ? Convert.ToInt32(txtzipBilling.Text) : 0; } addressbilling.CityID = txtcityBilling.Text.Length > 0 ? zipobjbilling.CityID : 0; addressbilling.Country = COUNTRY_NAME; addressbilling.CountryID = COUNTRY_ID; // If mailing address is provided if (chkMailingAddress.Checked == true) { addressmailing.IsMailing = true; addressmailing.Address1 = txtaddress1Mailing.Text; addressmailing.Address2 = txtaddress2Mailing.Text; if (Convert.ToInt32(ddlstateMailing.SelectedValue) > 0) { addressmailing.State = ddlstateMailing.SelectedItem.Text; addressmailing.StateID = Convert.ToInt32(ddlstateBilling.SelectedItem.Value); } else { addressmailing.State = string.Empty; } if (blnIsHost) { addressmailing.ZipID = txtzipMailing.Text.Length > 0 ? zipobjmailing.ZipID : 0; } else { addressmailing.ZipID = txtzipMailing.Text.Length > 0 ? Convert.ToInt32(txtzipMailing.Text) : 0; } addressmailing.City = txtcityMailing.Text; addressmailing.CityID = txtcityMailing.Text.Length > 0 ? zipobjmailing.CityID : 0; addressmailing.Zip = txtzipMailing.Text; addressmailing.Fax = ""; addressmailing.Country = COUNTRY_NAME; addressmailing.CountryID = COUNTRY_ID; } // Mailing address is same as billing address else { addressmailing.Address1 = addressbilling.Address1; addressmailing.Address2 = addressbilling.Address2; addressmailing.City = addressbilling.City; addressmailing.State = addressbilling.State; addressmailing.Zip = addressbilling.Zip; addressmailing.Country = addressbilling.Country; addressmailing.CityID = addressbilling.CityID; addressmailing.StateID = addressbilling.StateID; addressmailing.ZipID = addressbilling.ZipID; addressmailing.CountryID = addressbilling.CountryID; addressmailing.IsMailing = true; } if (ViewState["AddressIDMailing"] != null) { addressmailing.AddressID = Convert.ToInt32(ViewState["AddressIDMailing"].ToString()); } prospect.AddressMailing = addressmailing; prospect.FollowDate = DateTime.Now.ToShortDateString(); prospect.WillCommunicate = Convert.ToInt32(ddlFeederPromotionStatus.SelectedValue); if (ddlFeederPromotionStatus.SelectedValue.Equals("0")) { prospect.ReasonWillCommunicate = txtWillPromote.Text; } if (ViewState["FranchiseeID"] != null) { ArrayList arrtemp = (ArrayList)ViewState["FranchiseeID"]; prospect.FranchiseeID = arrtemp; //prospect.FranchiseeID = arrtemp.ToArray(); } objEProspectDetails.FacilitiesFee = txtFacilitiesFee.Text; string strPaymentMethod = string.Empty; foreach (ListItem li in chkPaymentMethod.Items) { if (li.Selected == true) { if (strPaymentMethod == "") { strPaymentMethod = li.Value; } else { strPaymentMethod = strPaymentMethod + "," + li.Value; } } } objEProspectDetails.PaymentMethod = strPaymentMethod; objEProspectDetails.DepositsRequire = Convert.ToInt16(rbtnDepositsRequired.SelectedValue); if (rbtnDepositsRequired.SelectedValue.Equals("1")) { objEProspectDetails.DepositsAmount = txtAmount.Text.Length > 0 ? Convert.ToDecimal(txtAmount.Text) : 0.0m; } objEProspectDetails.WillHost = Convert.ToInt16(ddlhostStatus.SelectedValue); objEProspectDetails.ViableHostSite = Convert.ToInt16(ddlViableHost.SelectedValue); objEProspectDetails.HostedInPast = Convert.ToInt16(ddlHostedInPast.SelectedValue); if (ddlhostStatus.SelectedValue.Equals("0")) { objEProspectDetails.ReasonWillHost = txtWillHost.Text; } if (ddlViableHost.SelectedValue.Equals("0")) { objEProspectDetails.ReasonViableHostSite = txtViableHostSite.Text; } if (ddlHostedInPast.SelectedValue.Equals("0")) { objEProspectDetails.ReasonHostedInPast = txtHostInPast.Text; } if (ddlHostedInPast.SelectedValue.Equals("1")) { objEProspectDetails.HostedInPastWith = txtHostedInPast.Text; } if (ViewState["ProspectDetailsID"] != null) { objEProspectDetails.ProspectDetailID = Convert.ToInt32(ViewState["ProspectDetailsID"].ToString()); } prospect.ProspectDetails = objEProspectDetails; prospect.ContactMeeting = null; prospect.ContactCall = null; prospect.Task = null; var currentSession = IoC.Resolve <ISessionContext>().UserSession; Session["Popup"] = "True"; if (blnIsHost) { UpdateHostWithContacts(prospect, currentSession.UserId.ToString(), currentSession.CurrentOrganizationRole.OrganizationId.ToString(), currentSession.CurrentOrganizationRole.RoleId.ToString()); } else { UpdateProspectWithContact(prospect, currentSession.UserId.ToString(), currentSession.CurrentOrganizationRole.OrganizationId.ToString(), currentSession.CurrentOrganizationRole.RoleId.ToString()); } ClientScript.RegisterStartupScript(typeof(Page), "Edit Prospect Host", "<script language='javascript' type='text/javascript' > CloseWindow(); </script>"); }
/// <summary> /// raise the Country dropdown index change event and Refill the /// </summary> /// <param name="sender"></param> /// <param name="e"></param> //protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e) //{ // DropDownList ddlcountry = (DropDownList)sender; // FillState(ddlcountry.ID); //} /// <summary> /// Change the city dropdown on change the state /// </summary> /// <param name="sender"></param> /// <param name="e"></param> //protected void ddlState_SelectedIndexChanged(object sender, EventArgs e) //{ // DropDownList ddlstate = (DropDownList)sender; // FillCity(ddlstate.ID); //} #endregion #region Methods /// <summary> /// this method save the MedicalVendor data to the database /// </summary> private void SaveMedicalVendor() { OtherDAL otherDal = new OtherDAL(); EZip objbuzip, objzip; objbuzip = otherDal.CheckCityZip(txtBuCity.Text, txtBZip.Text, ddlBState.SelectedValue); objzip = otherDal.CheckCityZip(txtCity.Text, txtZip.Text, ddlState.SelectedValue); if (objbuzip.CityID == 0) { ClientScript.RegisterStartupScript(typeof(string), "bujscode", "alert('City name entered for bussiness address is not valid.');", true); return; } else if (objbuzip.CityID > 0 && objbuzip.ZipID == 0) { ClientScript.RegisterStartupScript(typeof(string), "bujscode", "alert('Zip Code entered for bussiness address, corresponding to its city name, is not valid.');", true); return; } if (objzip.CityID == 0) { ClientScript.RegisterStartupScript(typeof(string), "jscode", "alert('City name entered for contact address is not valid.');", true); return; } else if (objzip.CityID > 0 && objzip.ZipID == 0) { ClientScript.RegisterStartupScript(typeof(string), "jscode", "alert('Zip Code entered for contact address, corresponding to its city name, is not valid.');", true); return; } // format phone no. CommonCode objCommonCode = new CommonCode(); //MVUserService service = new MVUserService(); EMedicalVendor MedicalVendor = new EMedicalVendor(); EAddress address = new EAddress(); EAddress Baddress = new EAddress(); EUser user = new EUser(); /// fill the default data. Edited data will be overwrite var currentSession = IoC.Resolve <ISessionContext>().UserSession; MedicalVendor = OrganizationUser.GetMedicalVendor(currentSession); MedicalVendor.BusinessName = txtVName.Text; MedicalVendor.BusinessFax = objCommonCode.FormatPhoneNumber(txtBFax.Text); MedicalVendor.BusinessPhone = objCommonCode.FormatPhoneNumber(txtBPhone.Text); MedicalVendor.Description = txtMVDesc.Text; Baddress.Address1 = txtBAddress1.Text; Baddress.Address2 = txtBAddress2.Text; Baddress.CityID = objbuzip.CityID; Baddress.StateID = Convert.ToInt32(ddlBState.SelectedValue); Baddress.CountryID = Convert.ToInt32(hfBusinessCountryID.Value); Baddress.ZipID = objbuzip.ZipID; MedicalVendor.BusinessAddress = Baddress; address.Address1 = txtAddress1.Text; address.Address2 = txtAddress2.Text; address.CityID = objzip.CityID; address.StateID = Convert.ToInt32(ddlState.SelectedValue); address.CountryID = Convert.ToInt32(hfCountryID.Value); address.ZipID = objzip.ZipID; MedicalVendor.MVUser.User.FirstName = txtFName.Text; MedicalVendor.MVUser.User.MiddleName = txtMName.Text; MedicalVendor.MVUser.User.LastName = txtLName.Text; MedicalVendor.MVUser.User.PhoneHome = objCommonCode.FormatPhoneNumber(txtPhoneHome.Text); MedicalVendor.MVUser.User.PhoneOffice = objCommonCode.FormatPhoneNumber(txtPhoneOther.Text); MedicalVendor.MVUser.User.PhoneCell = objCommonCode.FormatPhoneNumber(txtPhoneCell.Text); MedicalVendor.MVUser.User.EMail1 = txtEmail.Text; MedicalVendor.MVUser.User.EMail2 = txtEmail2.Text; MedicalVendor.MVUser.User.HomeAddress = address; MedicalVendor.MVUser.User.SSN = txtSSN.Text; MedicalVendor.MVUser.User.DOB = Convert.ToDateTime(txtDOB.Text).ToString(); Ucupdatephotopanel1.GetAllImages(); MedicalVendor.MVUser.MyPicture = Ucupdatephotopanel1.MyImage; MedicalVendor.MVUser.TeamPicture = Ucupdatephotopanel1.TeamImage; //MedicalVendor.MVUser.OtherPictures = Ucupdatephotopanel1.Images.ToArray(); MedicalVendor.MVUser.OtherPictures = Ucupdatephotopanel1.Images; MedicalVendor.SpecialInstruction = txtSplInstruction.Text; MedicalVendor.AccountHolder = txtAccountHolder.Text; MedicalVendor.AccountNumber = txtAccountNo.Text; MedicalVendor.AccountType = txtAccountType.Text; MedicalVendor.BankName = txtBankName.Text; MedicalVendor.RountingNumber = txtRoutingNumber.Text; MedicalVendor.Memo = txtMemo.Text; MedicalVendor.PaymentMode = (int)(Falcon.App.Core.Enum.EPaymentType)Enum.Parse(typeof(Falcon.App.Core.Enum.EPaymentType), ddlPayMode.SelectedItem.Value); MedicalVendor.Interval = (int)(PaymentFrequency)Enum.Parse(typeof(PaymentFrequency), ddlInterval.SelectedItem.Value); Int64 returnresult; if ((ViewState["IsEdit"] != null) && (ViewState["IsEdit"].ToString() != string.Empty)) { MedicalVendorDAL medicalvendorDAL = new MedicalVendorDAL(); returnresult = medicalvendorDAL.SaveMedicalVendor(MedicalVendor, Convert.ToInt32(EOperationMode.Update), currentSession.CurrentOrganizationRole.OrganizationId.ToString()); if (returnresult == 0) { returnresult = 9999991; } Response.RedirectUser(ResolveUrl("~/App/MedicalVendor/ProfilePage.aspx")); } }
public void SaveFacility() { var otherDal = new OtherDAL(); // format phone no. CommonCode objCommonCode = new CommonCode(); EZip checkCityZip = otherDal.CheckCityZip(txtCity.Text, txtZip.Text, ddlState.SelectedValue); if (checkCityZip.CityID == 0) { divErrorMsg.InnerText = "City name entered for address is not valid."; divErrorMsg.Style.Add(HtmlTextWriterStyle.Display, "block"); return; } else if (checkCityZip.CityID > 0 && checkCityZip.ZipID == 0) { divErrorMsg.InnerText = "Zipcode entered for address, corresponding to its city name, is not valid."; divErrorMsg.Style.Add(HtmlTextWriterStyle.Display, "block"); return; } EHospitalFacility objEHospitalFacility = new EHospitalFacility(); objEHospitalFacility.Address = new EAddress(); Int64 userid = IoC.Resolve <ISessionContext>().UserSession.UserId; string strCampaignIds = string.Empty; objEHospitalFacility.FacilityName = txtFacilityName.Text; if (ddlMedicalVendor.SelectedIndex > -1) { objEHospitalFacility.HospitalPartnerId = Convert.ToInt64(ddlMedicalVendor.SelectedValue); } if (ViewState["AddressID"] != null) { objEHospitalFacility.Address.AddressID = Convert.ToInt32(ViewState["AddressID"]); } objEHospitalFacility.Address.Address1 = txtAddress1.Text; objEHospitalFacility.Address.Address2 = txtAddress2.Text; objEHospitalFacility.Address.PhoneNumber = objCommonCode.FormatPhoneNumber(txtPhonePrimary.Text); objEHospitalFacility.PhoneCell = objCommonCode.FormatPhoneNumber(txtPhoneCell.Text); objEHospitalFacility.Address.CityID = checkCityZip.CityID; if (ddlState.SelectedIndex > -1) { objEHospitalFacility.Address.StateID = Convert.ToInt32(ddlState.SelectedValue); } if (!string.IsNullOrEmpty(hfCountryID.Value)) { objEHospitalFacility.Address.CountryID = Convert.ToInt32(hfCountryID.Value); } objEHospitalFacility.Address.ZipID = checkCityZip.ZipID; objEHospitalFacility.Email = txtEmail.Text; if (!string.IsNullOrEmpty(Request["FacilityID"])) { objEHospitalFacility.HospitalFacilityID = Convert.ToInt64(Request["FacilityID"]); } // Assign Campaigns if (!string.IsNullOrEmpty(hidCampaignID.Value)) { strCampaignIds = hidCampaignID.Value; strCampaignIds = strCampaignIds.Replace(",,", ","); } if (objEHospitalFacility.HospitalFacilityID > 0) { UpdateHospitalFacilty(objEHospitalFacility, userid, strCampaignIds); } else { SaveHospitalFacilty(objEHospitalFacility, userid, strCampaignIds); } // Redirect To Page if (ViewState["ReferredUrl"] != null && (string)ViewState["ReferredUrl"] != "") { Response.RedirectUser(this.ResolveUrl(ViewState["ReferredUrl"].ToString())); } else { // Manage Hospital Facility Response.RedirectUser(this.ResolveUrl("App/Franchisor/HospitalPartner/ManageHospitalPartnerFacility.aspx")); } }
/// <summary> /// this method save the franchisor data to the database /// </summary> private void SaveFranchisor() { // format phone no. CommonCode objCommonCode = new CommonCode(); OtherDAL otherDal = new OtherDAL(); EZip objczip = otherDal.CheckCityZip(txtCity.Text, txtzip1.Text, ddlstate.SelectedValue); if (objczip.CityID == 0) { ClientScript.RegisterStartupScript(typeof(string), "bujscode", "alert('City name entered for contact address is not valid.');", true); return; } else if (objczip.CityID > 0 && objczip.ZipID == 0) { ClientScript.RegisterStartupScript(typeof(string), "bujscode", "alert('Zip Code entered for contact address, corresponding to its city name, is not valid.');", true); return; } EFranchisorFranchisorUser franchisorfranchisoruser = new EFranchisorFranchisorUser(); EFranchisorUser franchisoruser = new EFranchisorUser(); EFranchisor franchisor = new EFranchisor(); franchisor.Active = true; //HealthYes.Web.UI.FranchisorFranchisorUserService.EAddress address = new HealthYes.Web.UI.FranchisorFranchisorUserService.EAddress(); var address = new Falcon.Entity.Other.EAddress(); address.Address1 = txtaddress1.Text; address.Address2 = string.Empty; address.CityID = objczip.CityID; address.StateID = Convert.ToInt32(ddlstate.SelectedValue); address.CountryID = Convert.ToInt32(hfCountryID.Value); address.ZipID = objczip.ZipID; //HealthYes.Web.UI.FranchisorFranchisorUserService.EUser user = new HealthYes.Web.UI.FranchisorFranchisorUserService.EUser(); var user = new Falcon.Entity.Other.EUser(); user.FirstName = txtfname.Text; user.MiddleName = txtMiddleName.Text.Length == 0 ? "" : txtMiddleName.Text; user.LastName = txtlname.Text; user.SSN = txtSSN.Text.Length == 0 ? "" : txtSSN.Text; user.DOB = Convert.ToDateTime(txtDOB.Text).ToString(); user.PhoneHome = txtphonehome.Text.Length == 0 ? "" : objCommonCode.FormatPhoneNumber(txtphonehome.Text); user.PhoneOffice = txtphoneother.Text.Length == 0 ? "" : objCommonCode.FormatPhoneNumber(txtphoneother.Text); user.PhoneCell = txtphonecell.Text.Length == 0 ? "" : objCommonCode.FormatPhoneNumber(txtphonecell.Text); user.EMail1 = txtEmail1.Text; user.EMail2 = txtEmail2.Text.Length == 0 ? "" : txtEmail2.Text; user.HomeAddress = address; Ucupdatephotopanel1.GetAllImages(); franchisoruser.OtherPictures = Ucupdatephotopanel1.Images; //franchisoruser.OtherPictures = Ucupdatephotopanel1.Images.ToArray(); franchisoruser.TeamPicture = Ucupdatephotopanel1.TeamImage; franchisoruser.MyPicture = Ucupdatephotopanel1.MyImage; franchisoruser.User = user; franchisorfranchisoruser.Franchisor = franchisor; franchisorfranchisoruser.FranchisorUser = franchisoruser; var sessionContext = IoC.Resolve <ISessionContext>(); if (ViewState["FranchisorFranchisorUserID"] != null && ViewState["Email"].ToString().Equals(txtEmail1.Text.Trim())) { if (ViewState["FranchisorFranchisorUserID"].ToString() != string.Empty) { FranchisorDAL franchisorDal = new FranchisorDAL(); var listFranchisorFranchisorUser = franchisorDal.GetFranchisorFranchisorUser(ViewState["FranchisorFranchisorUserID"].ToString(), 1); EFranchisorFranchisorUser[] FFUser = null; if (listFranchisorFranchisorUser != null) { FFUser = listFranchisorFranchisorUser.ToArray(); } if (FFUser != null) { franchisorfranchisoruser.FranchisorUser.User.UserID = Convert.ToInt32(ViewState["UserID"].ToString()); franchisorDal.SaveFranchisorFranchisorUser(franchisorfranchisoruser, Convert.ToInt32(EOperationMode.Update), sessionContext.UserSession.CurrentOrganizationRole.OrganizationId); Response.RedirectUser(ResolveUrl("~/App/Franchisor/FranchisorAdminUser.aspx?Action=Edited")); } } } else { IUserRepository <User> userRepository = IoC.Resolve <IUserRepository <User> >(); if (userRepository.UserNameExists(txtEmail1.Text)) { divErrorMsg.Visible = true; divErrorMsg.InnerHtml = "Contact email already exists. Please try another email."; return; } if (ViewState["FranchisorFranchisorUserID"] != null) { if (ViewState["FranchisorFranchisorUserID"].ToString() != string.Empty) { FranchisorDAL franchisorDal = new FranchisorDAL(); var listFranchisorFranchisorUser = franchisorDal.GetFranchisorFranchisorUser( ViewState["FranchisorFranchisorUserID"].ToString(), 1); EFranchisorFranchisorUser[] FFUser = null; if (listFranchisorFranchisorUser != null) { FFUser = listFranchisorFranchisorUser.ToArray(); } if (FFUser != null) { franchisorfranchisoruser.FranchisorUser.User.UserID = Convert.ToInt32(ViewState["UserID"].ToString()); franchisorDal.SaveFranchisorFranchisorUser(franchisorfranchisoruser, Convert.ToInt32(EOperationMode.Update), sessionContext.UserSession.CurrentOrganizationRole.OrganizationId); Response.RedirectUser(ResolveUrl("~/App/Franchisor/FranchisorAdminUser.aspx?Action=Edited")); } } } else { //service.AddFranchisorFranchisorUser(franchisorfranchisoruser, usershellmodulerole1, out returnresult, out temp); FranchisorDAL franchisorDal = new FranchisorDAL(); franchisorDal.SaveFranchisorFranchisorUser(franchisorfranchisoruser, Convert.ToInt32(EOperationMode.Insert), sessionContext.UserSession.CurrentOrganizationRole.OrganizationId); Response.RedirectUser(ResolveUrl("~/App/Franchisor/FranchisorAdminUser.aspx?Action=Added")); } } }
private void SaveMedicalVendor() { OtherDAL otherDal = new OtherDAL(); EZip objczip; // format phone no. CommonCode objCommonCode = new CommonCode(); objczip = otherDal.CheckCityZip(txtCity.Text, txtZip.Text, ddlState.SelectedValue); if (objczip.CityID == 0) { ClientScript.RegisterStartupScript(typeof(string), "bujscode", "alert('City name entered for contact address is not valid.');", true); return; } else if (objczip.CityID > 0 && objczip.ZipID == 0) { ClientScript.RegisterStartupScript(typeof(string), "bujscode", "alert('Zip Code entered for contact address, corresponding to its city name, is not valid.');", true); return; } EMVMVUser emvmvUser = new EMVMVUser(); EMedicalVendor medicalVendor = new EMedicalVendor(); if (ViewState["AuditRequired"] != null) emvmvUser.AuditRequired = Convert.ToBoolean(ViewState["AuditRequired"]); medicalVendor.BusinessName = ddlVendorName.SelectedItem.Text; if (ViewState["MedicalVendorID"] != null) { medicalVendor.MedicalVendorID = Convert.ToInt32(ViewState["MedicalVendorID"].ToString()); } else medicalVendor.MedicalVendorID = Convert.ToInt32(ddlVendorName.SelectedValue); EAddress address = new EAddress(); address.Address1 = txtAddress1.Text; address.Address2 = txtAddress2.Text; address.CityID = objczip.CityID; address.StateID = Convert.ToInt32(ddlState.SelectedValue); address.CountryID = Convert.ToInt32(hfCountryID.Value); address.ZipID = objczip.ZipID; EUser user = new EUser(); if (ViewState["UserID"] != null) { user.UserID = Convert.ToInt32(ViewState["UserID"].ToString()); } user.FirstName = txtFirstName.Text; user.MiddleName = txtMiddleName.Text; user.LastName = txtLastName.Text; user.PhoneCell = objCommonCode.FormatPhoneNumber(txtPhoneC.Text); user.PhoneHome = objCommonCode.FormatPhoneNumber(txtPhoneH.Text); user.PhoneOffice = objCommonCode.FormatPhoneNumber(txtPhoneO.Text); user.DOB = txtDOB.Text; user.SSN = txtSSN.Text; user.EMail1 = txtEmail1.Text; user.EMail2 = txtEmail2.Text; user.HomeAddress = address; var reference = new EReferences[3]; reference[0] = new EReferences { Name = string.Empty, EMail = string.Empty }; reference[1] = new EReferences { Name = string.Empty, EMail = string.Empty }; reference[2] = new EReferences { Name = string.Empty, EMail = string.Empty }; EMVUserSpecialization userSpecialization = new EMVUserSpecialization(); userSpecialization.MVUserSpecilaizationID = Convert.ToInt32(ddlSpecialization.SelectedValue); EMVUserClassification emvUserClassification = new EMVUserClassification(); emvUserClassification.MVUserClassificationID = Convert.ToInt32(ViewState["ClassificationID"]); EMVUser emvUser = new EMVUser(); Ucupdatephotopanel1.GetAllImages(); emvUser.OtherPictures = Ucupdatephotopanel1.Images; emvUser.MyPicture = Ucupdatephotopanel1.MyImage; if (ViewState["MVUserID"] != null) { emvUser.MVUserID = Convert.ToInt32(ViewState["MVUserID"].ToString()); } emvUser.User = user; emvUser.References = reference.ToList(); emvUser.MVUserSpecialization = userSpecialization; emvUser.MVUserClassification = emvUserClassification; emvUser.Address = address; //// For Resume string resumePath = ViewState["Resume"].ToString(); string signPath = ViewState["Signature"].ToString(); if ((hfResume.Value == "1") && fileResume.HasFile) { string filePath = Request.MapPath(ConfigurationManager.AppSettings["MVUploadResume"].ToString()); resumePath = ConfigurationManager.AppSettings["MVUploadResume"].ToString(); var fileInfo = new FileInfo(fileResume.FileName); if (!(fileInfo.Extension.Equals(".doc") || fileInfo.Extension.Equals(".docx") || fileInfo.Extension.Equals(".rtf") || fileInfo.Extension.Equals(".txt"))) { divErrorMsg.Visible = true; divErrorMsg.InnerHtml = "Invalid file format. It should be either of type doc, docx, rtf or txt"; return; } else { if (!Directory.Exists(filePath)) { Directory.CreateDirectory(filePath); } string saveFileName = fileResume.FileName + DateTime.Now.ToFileTimeUtc() + fileInfo.Extension; if (fileResume.HasFile) { fileResume.SaveAs(filePath + "\\" + saveFileName); } resumePath = resumePath + "/" + saveFileName; } } emvUser.Resume = resumePath; ////////////////////////signature////////////////////////////////// if ((hfSignature.Value == "1") && (fileSignature.FileName.Trim() != "")) { if (fileSignature.HasFile) { string signFilePath = Request.MapPath(ConfigurationManager.AppSettings["MVUploadSignature"].ToString()); signPath = ConfigurationManager.AppSettings["MVUploadSignature"].ToString(); var fileInfo = new FileInfo(fileSignature.FileName); if (!(fileInfo.Extension.ToLower().Equals(".jpeg") || fileInfo.Extension.ToLower().Equals(".jpg"))) { divErrorMsg.Visible = true; divErrorMsg.InnerHtml = "Please Check the file extension.It should be either of type jpg or jpeg"; return; } else { if (!Directory.Exists(signFilePath)) { Directory.CreateDirectory(signFilePath); } string saveFileName = fileSignature.FileName.Substring(0, fileSignature.FileName.IndexOf(".")) + DateTime.Now.ToFileTimeUtc() + fileInfo.Extension; if (fileSignature.HasFile) { fileSignature.PostedFile.SaveAs(signFilePath + "\\" + saveFileName); } signPath = signPath + "/" + saveFileName; } } } emvUser.DigitalSignature = signPath; emvmvUser.MedicalVendor = medicalVendor; if (ViewState["IsAuthorizationAllowed"] != null) emvmvUser.IsAuthorizationsAllowed = Convert.ToBoolean(ViewState["IsAuthorizationAllowed"]); if (ViewState["CutoffDate"] != null) emvmvUser.CutOffDate = ViewState["CutoffDate"].ToString(); if (ViewState["ShowEarningAmount"] != null) emvmvUser.ShowEarningAmount = Convert.ToBoolean(ViewState["ShowEarningAmount"]); emvmvUser.MVUser = emvUser; Int64 returnresult; var eUserShellModuleRole = new EUserShellModuleRole { RoleID = "1", ShellID = "1", UserID = "1" }; var medicalvendorDal = new MedicalVendorDAL(); returnresult = medicalvendorDal.SaveMedicalVendorUserProfile(emvmvUser, Convert.ToInt32(EOperationMode.Update), eUserShellModuleRole.UserID, Convert.ToInt64(eUserShellModuleRole.ShellID), eUserShellModuleRole.RoleID); if (txtPassword.Text.Length > 0) { var userLoginService = IoC.Resolve<IUserLoginService>(); var userContext = IoC.Resolve<SessionContext>(); userLoginService.ResetPassword(Convert.ToInt32(userContext.UserSession.UserId), txtPassword.Text, false, userContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId,false); } Response.RedirectUser(this.ResolveUrl("MedicalVendorUserProfile.aspx")); }