private void BindData()
        {
            QuotationDAL dal   = new QuotationDAL();
            var          quote = dal.GetQuoteByNo(QuoNo);

            lblDate.Text        = quote.CreatedDate.ToString("yyyy-MM-dd");
            lblContactName.Text = quote.CustomerContactName;
            if (!string.IsNullOrEmpty(quote.CustomerPhone1) && !string.IsNullOrEmpty(quote.CustomerPhone2))
            {
                lblPhone.Text = quote.CustomerPhone1 + "/" + quote.CustomerPhone2;
            }
            else
            {
                lblPhone.Text = quote.CustomerPhone1 + quote.CustomerPhone2;
            }
            lblEmail.Text   = quote.CustomerEmail;
            lblQQ.Text      = quote.CustomerQQ;
            lblAddress.Text = quote.CustomerAddress;
            lblIsCustomerProvideImage.Text = quote.IsCustomerProvideImage ? YesNoConsts.Yes : YesNoConsts.No;
            lblSampleToCustomer.Text       = quote.IsSampleProvidedToCustomer ? YesNoConsts.Yes : YesNoConsts.No;
            if (quote.IsSampleProvidedToCustomer)
            {
                lblTextSampleCode.Visible   = true;
                lblSampleToCustomer.Visible = true;
                lblSampleCode.Visible       = true;
                SampleProvidDAL sdal    = new SampleProvidDAL();
                var             samples = sdal.GetSampleBySource(SysConst.SourceTypeQuote, QuoNo);
                StringBuilder   sb      = new StringBuilder();
                foreach (var item in samples)
                {
                    sb.Append(item.SampleName).Append(",");
                }
                if (sb.Length > 0)
                {
                    sb.Remove(sb.Length - 1, 1);
                }
                lblSampleCode.Text = sb.ToString();
            }
            lblSurveyNeeded.Text = quote.IsSurveyNeeded ? YesNoConsts.Yes : YesNoConsts.No;
            if (quote.IsSurveyNeeded)
            {
                lblSurveyType.Text = quote.SurveyType;
            }
            lblProvideRefine.Text   = quote.IsCADRefinementNeeded ? YesNoConsts.Yes : YesNoConsts.No;
            lblProvideDelivery.Text = quote.DeliveryType;
            lblDeliveryType.Text    = quote.DeliveryType;
            lblDeliveryAddress.Text = quote.DeliveryToAddress;
            lblProvideInstall.Text  = quote.IsInstallProvided ? YesNoConsts.Yes : YesNoConsts.No;
            lblInstallType.Text     = quote.InstallType;

            //item
            LineItemDAL lDAL  = new LineItemDAL();
            var         items = lDAL.GetLineItemsBySource(quote.Quotation_Id, SysConst.SourceTypeQuote);

            Utility.BindDataToRepeater(rpItems, items);
            //bankinfo
            Utility.BindDataToDropdown(ddlBankInfo, Utility.GetLookupList("账户列表"));
            SetBankInfo();
        }
Example #2
0
        public override void BindControl()
        {
            SampleDAL            sampleDAL  = new SampleDAL();
            var                  samples    = sampleDAL.GetAllSamples();
            List <NameValueItem> sampleList = new List <NameValueItem>();

            foreach (var item in samples)
            {
                sampleList.Add(new NameValueItem()
                {
                    Name = item.SampleCode + "/" + item.MaterialName, Value = item.SampleCode
                });
            }
            Utility.BindDataToDropdown(ddlProductFrom, sampleList);
            Utility.BindDataToDropdown(ddlProduct, sampleList);

            SampleProvidDAL dal  = new SampleProvidDAL();
            var             list = dal.GetSampleBySource(SourceType, SourceNo);

            this.rpSampleFromCustomer.DataSource = list.Where(l => l.SampleDirection == SysConst.SampleDirectionFrom);
            this.rpSampleFromCustomer.DataBind();
            this.rpSampleToCustomer.DataSource = list.Where(l => l.SampleDirection == SysConst.SampleDirectionTo);
            this.rpSampleToCustomer.DataBind();
        }