Пример #1
0
        protected void btnSubmite_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                ApplicationSettingsModel model;
                //model = client.GetMemberByIDNum(txtCompanyName.Text, ParlourId);
                //if (model != null)
                //{
                //    ShowMessage(ref lblMessage, MessageType.Danger, "Member Already Exists.");
                //}
                //else
                //{
                model = new ApplicationSettingsModel();
                model.pkiApplicationID     = ApplicationID;
                model.ApplicationName      = txtCompanyName.Text;
                model.ApplicationLogoPath  = string.Empty;
                model.OwnerFirstName       = txtownFirstName.Text;
                model.OwnerSurname         = txtownLastName.Text;
                model.OwnerTelNumber       = txtownTelephoneNumber.Text;
                model.OwnerCellNumber      = txtOwnersCellphone.Text;
                model.ManagerFirstName     = string.Empty;
                model.ManageSurname        = string.Empty;
                model.ManageTelNumber      = txtTelePhone.Text;
                model.ManageCellNumber     = txtCellphone.Text;
                model.BusinessAddressLine1 = txtline1.Text;
                model.BusinessAddressLine2 = txtline2.Text;
                model.BusinessAddressLine3 = txtline3.Text;
                model.BusinessAddressLine4 = txtline4.Text;
                model.BusinessPostalCode   = txtpostalcode.Text;
                model.FSBNumber            = txtFsbNumber.Text;
                model.CereliaAPIKey        = string.Empty;
                model.RegistrationNumber   = txtRegistrationNumber.Text;
                model.ManageSlogan         = txtCompanySlogan.Text;
                model.ManageEmail          = txtEmail.Text;
                model.ManageFaxNumber      = txtFaxNumber.Text;
                model.OwnerEmail           = txtOwnersEmail.Text;
                model.ApplicationRules     = txtcompanyRules.Text;
                model.VatNo = txtVatNo.Text;
                //===============================Allow Auto generate Policy Number===============
                Boolean PolicyNumber = false;
                if (cbAutoGeneratePolicy.Checked)
                {
                    PolicyNumber = true;
                }
                else
                {
                    PolicyNumber = false;
                }
                model.IsAutoGeneratedPolicyNo = PolicyNumber;

                //======================================
                //model.ApplicationLogo = txtOwnersEmail.Text;
                //model.ApplicationRules = txtOwnersEmail.Text;


                if (ApplicationID > 0)
                {
                    model.parlourid = new Guid("00000000-0000-0000-0000-000000000000");
                }
                else
                {
                    model.parlourid = Guid.NewGuid();
                }
                //=============
                model.Currentparlourid = ParlourId;
                //================================================================
                model = client.SaveApplication(model);
                UploadImage(model.pkiApplicationID);
                Guid retID = model.parlourid;
                //=========================================================================
                //ApplicationAdditionalInsert
                AdditionalApplicationSettingsModel Adsmodel = new AdditionalApplicationSettingsModel();
                Adsmodel.pkiParlourid = model.parlourid;
                Adsmodel.spUPuser     = "";
                Adsmodel.spUPpass     = "";
                Adsmodel.spUPpinpad   = "";
                Adsmodel.spValuser    = "";
                Adsmodel.spValpass    = "";
                Adsmodel.spValpinpad  = "";
                Adsmodel.spCCuser     = "";
                Adsmodel.spCCpass     = "";
                Adsmodel.spCCpinpad   = "";
                string membernumber = "no";
                if (PolicyNumber)
                {
                    membernumber = "yes";
                }
                Adsmodel.GenerateMember = membernumber;

                Adsmodel = client.SaveAdditionalApplication(Adsmodel);

                // ==========================[ SMS Group Insert Delete ]===================================
                int sguserID = 0;
                foreach (ListItem lst in chksmsGroup.Items)
                {
                    if (lst.Selected)
                    {
                        smsSendingGroupModel modelS = new smsSendingGroupModel();
                        modelS.ID              = sguserID;
                        modelS.fkiCompanyID    = model.pkiApplicationID;
                        modelS.fkismstempletID = Convert.ToInt32(lst.Value);
                        modelS.smstempletName  = lst.Text;
                        modelS.LastModified    = System.DateTime.Now;
                        modelS.ModifiedUser    = UserName;
                        sguserID = client.SaveSmsGroupDetails(modelS);
                    }
                }
                //   ==========================[END SMS Group Insert Delete ]===================================

                //   ==========================[Start Banking Detail Insert Delete ]===================================
                BankingDetailSending Model;

                Model = new BankingDetailSending();
                //Model.ID = ApplicationID;
                Model.AccountHolder = txtaccountholder.Text;
                Model.Bankname      = txtbankname.Text;
                Model.AccountNumber = txtaccountnumber.Text;
                Model.Accounttype   = txtaccounttype.Text;
                Model.Branch        = txtbranch.Text;
                Model.Branchcode    = txtbranchcode.Text;
                Model.LastModified  = System.DateTime.Now;
                Model.ModifiedUser  = UserName;
                Model.parlourid     = retID;


                Model = client.SaveBankingDetail(Model);

                //   ==========================[END Banking Detail Insert Delete ]===================================
                //================================[Insert Update Terms & Condition]===============================
                ApplicationTnCModel objtc = new ApplicationTnCModel();
                objtc.pkiAppTC                   = ApplicationID;
                objtc.fkiApplicationID           = ApplicationID;
                objtc.TermsAndCondition          = txtTnC.Text;
                objtc.LastModified               = DateTime.Now;
                objtc.ModifiedUser               = UserName;
                objtc.parlourid                  = retID;
                objtc.TermsAndConditionFuneral   = txtTncFuneral.Text;
                objtc.TermsAndConditionTombstone = txtTncTombstone.Text;
                objtc.Declaration                = txtPolicyDeclaration.Text;
                int a = client.SaveTermsAndCondition(objtc);



                if (ApplicationID > 0)
                {
                    BindAllApplicationDetails();
                    if (PaymentHistory.Visible != false)
                    {
                        ClearControl();
                    }
                }
                else
                {
                    CompanyParlourID = retID;
                    Response.Redirect("~/Tools/UserSetup.aspx?CompanyParlourID=" + CompanyParlourID + "&NewId=1");
                }


                //bindEasyPayNumber();
                ShowMessage(ref lblMessage, MessageType.Success, "Company Details successfully saved");
                //}
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "goToTab512", "goToTab(5)", true);
            }
        }
Пример #2
0
 public static int SaveTermsAndCondition(ApplicationTnCModel Model1)
 {
     return(ToolsSetingDAL.SaveTermsAndCondition(Model1));
 }