Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(SourceType) && !string.IsNullOrEmpty(SourceNo))
                {
                    Utility.BindDataToDropdown(ddlEnqOrdMan, Utility.GetUserList2(true));
                    Utility.BindDataToDropdown(ddlQuoteMan, Utility.GetUserList2(true));
                    //link
                    if (string.Equals(SourceType, SysConst.SourceTypeEnquiry, StringComparison.OrdinalIgnoreCase))
                    {
                        EnquiryDAL eDAL = new EnquiryDAL();
                        var        enq  = eDAL.GetEnquiryByNo(SourceNo);
                        lnkSource.NavigateUrl = Page.ResolveUrl(string.Format("~/enquiryform.aspx?enqno={0}&enqid={1}", SourceNo, enq.Enquiry_Id));
                    }
                    else
                    {
                        OrderDAL sDAL = new OrderDAL();
                        var      ord  = sDAL.GetOrderByNo(SourceNo);
                        lnkSource.NavigateUrl = Page.ResolveUrl(string.Format("~/orderform.aspx?ordno={0}&ordid={1}&sourcetype={2}&sourceno={3}", SourceNo, ord.Order_Id, ord.SourceType, ord.SourceNo));
                    }
                    lnkSource.Text = SourceNo;

                    QuotationDAL dal   = new QuotationDAL();
                    var          quote = dal.GetQuoteByNo(QuoteNo);
                    //basic
                    txtCreatedDate.Text = quote.CreatedDate.ToString("yyyy-MM-dd");

                    ddlEnqOrdMan.SelectedValue = quote.EnqOrdMan;
                    ddlQuoteMan.SelectedValue  = quote.QuotationMan;
                    txtQuoteIntro.Text         = quote.QuotationIntro;

                    //customer info
                    this.customerInfoControl.SetValue(
                        quote.CustomerCompanyName,
                        quote.CustomerContactName,
                        quote.CustomerAddress,
                        quote.CustomerEmail,
                        quote.CustomerQQ,
                        quote.CustomerPhone1,
                        quote.CustomerPhone2,
                        quote.CustomerOthers);
                    //lineitem
                    UIUtility.BindUserControl(lineItemsControl, SysConst.SourceTypeQuote, quote.Quotation_Id);
                    //sample
                    this.SampleControl1.SetValue(quote.IsSampleProvidedToCustomer, quote.IsCustomerProvideSample);
                    UIUtility.BindUserControl(SampleControl1, SysConst.SourceTypeQuote, quote.Quotation_No);
                    //customer drawing
                    customerDrawingControl.IsCustomerProvideImage = quote.IsCustomerProvideImage;
                    UIUtility.BindUserControl(customerDrawingControl, SysConst.SourceTypeQuote, quote.Quotation_No);
                    //survey
                    SurveyEditControl1.IsSurveyNeed = quote.IsSurveyNeeded;
                    SurveyEditControl1.SurveyIntro  = quote.SurveyIntro;
                    UIUtility.BindUserControl(SurveyEditControl1, SysConst.SourceTypeQuote, quote.Quotation_No);
                    SurveyEditControl1.SetSurveyType(quote.SurveyType);
                    //cad
                    CADEditControl1.IsCADRefinementNeeded           = quote.IsCADRefinementNeeded;
                    CADEditControl1.RefineIntro                     = quote.CADRefinementIntro;
                    CADEditControl1.IsCustomerCADConfirmationNeeded = quote.IsCADNeedCustomerConfirmation;
                    UIUtility.BindUserControl(CADEditControl1, SysConst.SourceTypeQuote, quote.Quotation_No);
                    //delivery
                    DeliveryEditControl1.DeliveryIntro     = quote.DeliveryIntro;
                    DeliveryEditControl1.DeliveryToAddress = quote.DeliveryToAddress;
                    UIUtility.BindUserControl(DeliveryEditControl1, SysConst.SourceTypeQuote, quote.Quotation_No);
                    DeliveryEditControl1.SetDeliveryType(quote.DeliveryType);
                    //install
                    InstallEditControl1.IsInstallProvided = quote.IsInstallProvided;
                    InstallEditControl1.InstallIntro      = quote.InstallIntro;
                    UIUtility.BindUserControl(InstallEditControl1, SysConst.SourceTypeQuote, quote.Quotation_No);
                    InstallEditControl1.SetInstallType(quote.InstallType);
                    //quotation
                    UIUtility.BindUserControl(quotationControl, SourceType, SourceNo);
                    //survey
                    UIUtility.BindUserControl(surveyControl, SourceType, SourceNo);
                    //customer provide drawing
                    UIUtility.BindUserControl(customerDrawingControl1, SourceType, SourceNo);
                    //refine
                    UIUtility.BindUserControl(cADRefinementControl, SourceType, SourceNo);
                    //intro
                    UIUtility.BindUserControl(FooterIntroControl1, SysConst.SourceTypeQuote, quote.Quotation_No);
                    //followup
                    UIUtility.BindUserControl(followUpControl, SysConst.SourceTypeQuote, quote.Quotation_No);

                    //status dropdown
                    Utility.BindDataToDropdown(this.ddlQuotationStatus, Utility.GetQuotationStatusList());
                    ddlQuotationStatus.SelectedValue = quote.Status;
                    if (string.Equals(quote.Status, "报价完成", StringComparison.OrdinalIgnoreCase) ||
                        string.Equals(quote.Status, "待确认", StringComparison.OrdinalIgnoreCase) ||
                        string.Equals(quote.Status, "确认", StringComparison.OrdinalIgnoreCase) ||
                        string.Equals(quote.Status, "不确认", StringComparison.OrdinalIgnoreCase)
                        )
                    {
                        SetControlsStatus(false);
                        ddlQuotationStatus.Enabled = true;
                        btnChangeStatus.Enabled    = true;
                        btnPrint.Disabled          = false;
                        btnCopy.Enabled            = true;
                    }

                    if (quote.Status != "编辑中")
                    {
                        SetControlsStatus(false);
                        SetControlEnabled(btnChangeStatus, true);
                        SetControlEnabled(ddlQuotationStatus, true);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //dropdown
                Utility.BindDataToDropdown(ddlOrderStatus, Utility.GetOrderStatusList());
                Utility.BindDataToDropdown(ddlOrdMan, Utility.GetUserList2(true));

                if (!string.IsNullOrWhiteSpace(OrdNo))
                {
                    OrderDAL dal = new OrderDAL();
                    var      ord = dal.GetOrderById(OrdId);
                    txtOrdNo.Text = ord.Order_No;
                    //link
                    if (string.Equals(SourceType, SysConst.SourceTypeEnquiry, StringComparison.OrdinalIgnoreCase))
                    {
                        lnkSource.NavigateUrl = Page.ResolveUrl(string.Format("~/enquiryform.aspx?enqno={0}", SourceNo));
                    }
                    else if (string.Equals(SourceType, SysConst.SourceTypeQuote, StringComparison.OrdinalIgnoreCase))
                    {
                        QuotationDAL qDAL  = new QuotationDAL();
                        var          quote = qDAL.GetQuoteByNo(SourceNo);
                        lnkSource.NavigateUrl = Page.ResolveUrl(string.Format("~/quotationform.aspx?quono={0}&quoid={1}&sourceno={2}&sourcetype={3}", quote.Quotation_No, quote.Quotation_Id, quote.SourceNo, quote.SourceType));
                    }

                    if (!string.IsNullOrEmpty(SourceNo))
                    {
                        this.lnkSource.Text = SourceNo;
                    }
                    this.txtCreatedDate.Text  = ord.CreatedDate.ToString("yyyy-MM-dd");
                    ddlOrdMan.SelectedValue   = ord.OrderMan;
                    this.txtOrderSummary.Text = ord.OrderIntro;
                    //customer info
                    this.customerInfoControl.SetValue(
                        ord.CustomerCompanyName,
                        ord.CustomerContactName,
                        ord.CustomerAddress,
                        ord.CustomerEmail,
                        ord.CustomerQQ,
                        ord.CustomerPhone1,
                        ord.CustomerPhone2,
                        ord.CustomerOthers);
                    //lineitem
                    UIUtility.BindUserControl(lineItemsControl, SysConst.SourceTypeOrder, ord.Order_Id);
                    //sample
                    this.SampleControl1.SetValue(ord.IsSampleProvidedToCustomer, ord.IsCustomerProvideSample);
                    UIUtility.BindUserControl(SampleControl1, SysConst.SourceTypeOrder, ord.Order_No);
                    //customer drawing
                    customerDrawingControl.IsCustomerProvideImage = ord.IsCustomerProvideImage;
                    UIUtility.BindUserControl(customerDrawingControl, SysConst.SourceTypeOrder, ord.Order_No);
                    //survey
                    SurveyEditControl1.IsSurveyNeed = ord.IsSurveyNeeded;
                    SurveyEditControl1.SurveyIntro  = ord.SurveyIntro;
                    UIUtility.BindUserControl(SurveyEditControl1, SysConst.SourceTypeOrder, ord.Order_No);
                    SurveyEditControl1.SetSurveyType(ord.SurveyType);
                    //cad
                    CADEditControl1.IsCADRefinementNeeded           = ord.IsCADRefinementNeeded;
                    CADEditControl1.RefineIntro                     = ord.CADRefinementIntro;
                    CADEditControl1.IsCustomerCADConfirmationNeeded = ord.IsCADNeedCustomerConfirmation;
                    UIUtility.BindUserControl(CADEditControl1, SysConst.SourceTypeOrder, ord.Order_No);
                    //delivery
                    DeliveryEditControl1.DeliveryIntro     = ord.DeliveryIntro;
                    DeliveryEditControl1.DeliveryToAddress = ord.DeliveryToAddress;
                    UIUtility.BindUserControl(DeliveryEditControl1, SysConst.SourceTypeOrder, ord.Order_No);
                    DeliveryEditControl1.SetDeliveryType(ord.DeliveryType);

                    //install
                    InstallEditControl1.IsInstallProvided = ord.IsInstallProvided;
                    InstallEditControl1.InstallIntro      = ord.InstallIntro;
                    UIUtility.BindUserControl(InstallEditControl1, SysConst.SourceTypeOrder, ord.Order_No);
                    InstallEditControl1.SetInstallType(ord.InstallType);
                    //history quote
                    UIUtility.BindUserControl(quotationControl, SysConst.SourceTypeOrder, ord.Order_No);
                    //survey
                    UIUtility.BindUserControl(surveyControl, SysConst.SourceTypeOrder, ord.Order_No);
                    //refine
                    UIUtility.BindUserControl(cADRefinementControl, SysConst.SourceTypeOrder, ord.Order_No);
                    //machining
                    UIUtility.BindUserControl(MachiningControl1, SysConst.SourceTypeOrder, ord.Order_No);
                    //purchase
                    UIUtility.BindUserControl(PurchaseControl1, SysConst.SourceTypeOrder, ord.Order_No);
                    //delivery
                    UIUtility.BindUserControl(DeliveryControl1, SysConst.SourceTypeOrder, ord.Order_No);
                    //settlement
                    UIUtility.BindUserControl(SettlementControl1, SysConst.SourceTypeOrder, ord.Order_No);
                    //receivable
                    UIUtility.BindUserControl(ReceiptControl1, SysConst.SourceTypeOrder, ord.Order_No);
                    //introduction
                    UIUtility.BindUserControl(FooterIntroControl1, SysConst.SourceTypeOrder, ord.Order_No);
                    //status
                    ddlOrderStatus.SelectedValue = ord.Status;
                    //followup
                    UIUtility.BindUserControl(followUpControl, SysConst.SourceTypeOrder, ord.Order_No);
                }
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //dropdown
                Utility.BindDataToDropdown(ddlEnquiryStatus, Utility.GetEnquiryStatusList());
                Utility.BindDataToDropdown(ddlEnqMan, Utility.GetUserList2(true));
                if (!string.IsNullOrWhiteSpace(EnqNo))
                {
                    EnquiryDAL dal = new EnquiryDAL();
                    var        enq = dal.GetEnquiryById(EnqId);
                    txtEnqNo.Text            = enq.Enquiry_No;
                    this.txtCreatedDate.Text = enq.CreatedDate.ToString("yyyy-MM-dd");
                    this.txtRemark.Text      = enq.Remark;
                    this.txtBeginDate.Text   = enq.ExpectedBeginDate != null?enq.ExpectedBeginDate.Value.ToString("yyyy-MM-dd") : string.Empty;

                    this.txtEndDate.Text = enq.ExpectedEndDate != null?enq.ExpectedEndDate.Value.ToString("yyyy-MM-dd") : string.Empty;

                    this.txtTimeLimitRemark.Text = enq.TimeLimitRemark;
                    this.lblStatus.Text          = enq.Status;
                    this.ddlEnqMan.SelectedValue = enq.EnqMan;
                    this.txtEnqSummary.Text      = enq.Summary;
                    //customer info
                    this.customerInfoControl.SetValue(
                        enq.CustomerCompanyName,
                        enq.CustomerContactName,
                        enq.CustomerAddress,
                        enq.CustomerEmail,
                        enq.CustomerQQ,
                        enq.CustomerPhone1,
                        enq.CustomerPhone2,
                        enq.CustomerOthers);
                    //enq content
                    UIUtility.BindUserControl(lineItemsControl, SysConst.SourceTypeEnquiry, enq.Enquiry_Id);
                    //enq img
                    enquiryImageControl.ImagePath = enq.EnquiryImgPath;
                    enquiryImageControl.EnquiryId = enq.Enquiry_Id;
                    UIUtility.BindUserControl(enquiryImageControl, SysConst.SourceTypeSurvey, enq.Enquiry_No);
                    //sample
                    this.SampleControl1.SetValue(enq.IsSampleProvidedToCustomer, enq.IsCustomerProvideSample);
                    UIUtility.BindUserControl(SampleControl1, SysConst.SourceTypeEnquiry, enq.Enquiry_No);
                    //customer drawing
                    customerDrawingControl.IsCustomerProvideImage = enq.IsCustomerProvideImage;
                    UIUtility.BindUserControl(customerDrawingControl, SysConst.SourceTypeEnquiry, enq.Enquiry_No);
                    //survey
                    SurveyEditControl1.IsSurveyNeed = enq.IsSurveyNeeded;
                    SurveyEditControl1.SurveyIntro  = enq.SurveyIntro;
                    UIUtility.BindUserControl(SurveyEditControl1, SysConst.SourceTypeEnquiry, enq.Enquiry_No);
                    SurveyEditControl1.SetSurveyType(enq.SurveyType);
                    //cad
                    CADEditControl1.IsCADRefinementNeeded           = enq.IsCADRefinementNeeded;
                    CADEditControl1.RefineIntro                     = enq.CADRefinementIntro;
                    CADEditControl1.IsCustomerCADConfirmationNeeded = enq.IsCADNeedCustomerConfirmation;
                    UIUtility.BindUserControl(CADEditControl1, SysConst.SourceTypeEnquiry, enq.Enquiry_No);
                    //delivery
                    DeliveryEditControl1.DeliveryIntro     = enq.DeliveryIntro;
                    DeliveryEditControl1.DeliveryToAddress = enq.DeliveryToAddress;
                    UIUtility.BindUserControl(DeliveryEditControl1, SysConst.SourceTypeEnquiry, enq.Enquiry_No);
                    DeliveryEditControl1.SetDeliveryType(enq.DeliveryType);
                    //install
                    InstallEditControl1.IsInstallProvided = enq.IsInstallProvided;
                    InstallEditControl1.InstallIntro      = enq.InstallIntro;
                    UIUtility.BindUserControl(InstallEditControl1, SysConst.SourceTypeEnquiry, enq.Enquiry_No);
                    InstallEditControl1.SetInstallType(enq.InstallType);
                    //quote
                    UIUtility.BindUserControl(quotationControl, SysConst.SourceTypeEnquiry, enq.Enquiry_No);
                    //survey
                    UIUtility.BindUserControl(surveyControl, SysConst.SourceTypeEnquiry, enq.Enquiry_No);
                    //refine
                    UIUtility.BindUserControl(cADRefinementControl, SysConst.SourceTypeEnquiry, enq.Enquiry_No);
                    //intro
                    UIUtility.BindUserControl(FooterIntroControl1, SysConst.SourceTypeEnquiry, enq.Enquiry_No);
                    //status
                    ddlEnquiryStatus.SelectedValue = enq.Status;
                    //followup
                    UIUtility.BindUserControl(followUpControl, SysConst.SourceTypeEnquiry, enq.Enquiry_No);
                }
            }
        }