Exemplo n.º 1
0
        public void BindApplicationToUpdate()
        {
            ApplicationSettingsModel modelCompany;

            modelCompany = client.GetApplictionByID(ApplicationID);
            if (modelCompany != null)
            {
                ApplicationID              = modelCompany.pkiApplicationID;
                txtCompanyName.Text        = modelCompany.ApplicationName;
                txtownFirstName.Text       = modelCompany.OwnerFirstName;
                txtownLastName.Text        = modelCompany.OwnerSurname;
                txtownTelephoneNumber.Text = modelCompany.OwnerTelNumber;
                txtOwnersCellphone.Text    = modelCompany.OwnerCellNumber;
                txtTelePhone.Text          = modelCompany.ManageTelNumber;
                txtCellphone.Text          = modelCompany.ManageCellNumber;
                txtline1.Text              = modelCompany.BusinessAddressLine1;
                txtline2.Text              = modelCompany.BusinessAddressLine2;
                txtline3.Text              = modelCompany.BusinessAddressLine3;
                txtline4.Text              = modelCompany.BusinessAddressLine4;
                txtpostalcode.Text         = modelCompany.BusinessPostalCode;
                txtFsbNumber.Text          = modelCompany.FSBNumber;
                txtRegistrationNumber.Text = modelCompany.RegistrationNumber;
                txtCompanySlogan.Text      = modelCompany.ManageSlogan;
                txtEmail.Text              = modelCompany.ManageEmail;
                txtFaxNumber.Text          = modelCompany.ManageFaxNumber;
                txtOwnersEmail.Text        = modelCompany.OwnerEmail;
                txtcompanyRules.Text       = modelCompany.ApplicationRules;
                txtVatNo.Text              = modelCompany.VatNo;


                if (modelCompany.ApplicationLogo != null)
                {
                    string base64String = Convert.ToBase64String(modelCompany.ApplicationLogo, 0, modelCompany.ApplicationLogo.Length);
                    ImagePreview.ImageUrl = "data:image/png;base64," + base64String;
                }
                else
                {
                    ImagePreview.ImageUrl = string.Empty;
                }
                Boolean AutoGeneratePolicyNo = modelCompany.IsAutoGeneratedPolicyNo;
                if (AutoGeneratePolicyNo == null || AutoGeneratePolicyNo == false)
                {
                    cbAutoGeneratePolicy.Checked = false;
                }
                else if (AutoGeneratePolicyNo == true)
                {
                    cbAutoGeneratePolicy.Checked = true;
                }

                //foreach (ListItem lst in chksmsGroup.Items)
                //{
                //    lst.Selected = false;
                //}
                smsSendingGroupModel[] modelS = client.EditsmsGroupbyID(ApplicationID);
                foreach (smsSendingGroupModel lstModel in modelS)
                {
                    foreach (ListItem lst in chksmsGroup.Items)
                    {
                        if (Convert.ToInt32(lst.Value) == lstModel.fkismstempletID)
                        {
                            lst.Selected = true;
                        }
                    }
                }



                BankingDetailSending Modelbank;
                Modelbank = client.GetBankingByID(modelCompany.parlourid);
                if (Modelbank != null)
                {
                    txtaccountholder.Text = Modelbank.AccountHolder;
                    txtbankname.Text      = Modelbank.Bankname;
                    txtaccountnumber.Text = Modelbank.AccountNumber;
                    txtaccounttype.Text   = Modelbank.Accounttype;
                    txtbranch.Text        = Modelbank.Branch;
                    txtbranchcode.Text    = Modelbank.Branchcode;
                }
                ApplicationTnCModel ModelTnc;
                ModelTnc = client.SelectApplicationTermsAndCondition(modelCompany.parlourid);
                if (ModelTnc != null)
                {
                    txtTnC.Text               = ModelTnc.TermsAndCondition;
                    txtTncFuneral.Text        = ModelTnc.TermsAndConditionFuneral;
                    txtTncTombstone.Text      = ModelTnc.TermsAndConditionTombstone;
                    txtPolicyDeclaration.Text = ModelTnc.Declaration;
                }

                btnSubmite.Text   = "Update";
                btnUpload.Enabled = true;
            }
        }