Пример #1
0
        public void BindCompany()
        {
            ApplicationSettingsModel modelCompany;

            modelCompany = client.GetApplictionByParlourID(ParlourId);
            if (modelCompany != null)
            {
                lblAppliName.Text = modelCompany.ApplicationName.ToString();
                lblAdd1.Text      = modelCompany.BusinessAddressLine1.ToString();
                lblAdd2.Text      = modelCompany.BusinessAddressLine2.ToString();
                lblAdd3.Text      = modelCompany.BusinessAddressLine3.ToString();
                lblAdd4.Text      = modelCompany.BusinessAddressLine4.ToString();
                lblCode.Text      = modelCompany.BusinessPostalCode.ToString();
                lblEmail.Text     = modelCompany.ManageEmail.ToString();
                lblVat.Text       = modelCompany.VatNo.ToString();
                lblSlogan.Text    = modelCompany.ManageSlogan.ToString();

                lblTelephone.Text  = modelCompany.OwnerTelNumber;
                lblCellNumber.Text = modelCompany.OwnerCellNumber;

                lblContactEmail.Text = modelCompany.OwnerEmail;

                BankingDetailSending Modelbank = client.GetBankingByID(modelCompany.parlourid);
                if (Modelbank != null)
                {
                    StringBuilder sb = new StringBuilder();
                    sb.AppendFormat("<b>Account Holder &#09;:</b>{0}<br/>", Modelbank.AccountHolder);
                    sb.AppendFormat("<b>Bank name &#09;:</b>{0}<br/>", Modelbank.Bankname);
                    sb.AppendFormat("<b>Account Number &#09;:</b>{0}<br/>", Modelbank.AccountNumber);
                    sb.AppendFormat("<b>Account type &#09;:</b>{0}<br/>", Modelbank.Accounttype);
                    sb.AppendFormat("<b>Branch &#09;:</b>{0}<br/>", Modelbank.Branch);
                    sb.AppendFormat("<b>Branch code &#09;:</b>{0}<br/>", Modelbank.Branchcode);
                    lblBankDetails.Text = sb.ToString();
                }

                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;
                }
                ApplicationTnCModel ModelTnc;
                ModelTnc = client.SelectApplicationTermsAndCondition(modelCompany.parlourid);
                if (ModelTnc != null)
                {
                    if (QuotationID != 0 && ParlourId != Guid.Empty)
                    {
                        lblTNC.Text = ModelTnc.TermsAndCondition;
                    }
                    else if (FID != 0 && ParlourId != Guid.Empty)
                    {
                        lblTNC.Text = ModelTnc.TermsAndConditionFuneral;
                    }
                    else if (TBID != 0 && ParlourId != Guid.Empty)
                    {
                        lblTNC.Text = ModelTnc.TermsAndConditionTombstone;
                    }
                }
            }
        }
Пример #2
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;
            }
        }