Beispiel #1
0
        public override void BindControl()
        {
            QuotationDAL     dal     = new QuotationDAL();
            var              quotes  = dal.GetQuotesBySource(SourceType, SourceNo);
            List <Quotation> quotes2 = new List <Quotation>();
            string           enqNo   = string.Empty;
            Order            ord     = new Order();

            if (string.Equals(SourceType, SysConst.SourceTypeEnquiry, StringComparison.OrdinalIgnoreCase))
            {
                ord = new OrderDAL().GetOrderByEnq(SourceNo);
                if (ord != null)
                {
                    quotes2 = dal.GetQuotesBySource(SysConst.SourceTypeOrder, ord.Order_No);
                }
            }
            else if (string.Equals(SourceType, SysConst.SourceTypeOrder, StringComparison.OrdinalIgnoreCase))
            {
                ord = new OrderDAL().GetOrderByNo(SourceNo);
                if (!string.IsNullOrEmpty(ord.EnqNo))
                {
                    var enq = new EnquiryDAL().GetEnquiryByNo(ord.EnqNo);
                    quotes2 = dal.GetQuoteByEnq(enq.Enquiry_No);
                }
            }
            quotes.AddRange(quotes2);
            var result = quotes.Distinct(new QuotationComparer()).OrderBy(q => q.Quotation_No);

            Utility.BindDataToRepeater(rpQuotation, result);
        }
Beispiel #2
0
        protected void btnGenerateOrder_Click(object sender, EventArgs e)
        {
            var quote = new QuotationDAL().GetQuoteByNo(GetQueryStringValue("quono"));

            if (string.Equals(quote.SourceType, SysConst.SourceTypeOrder, StringComparison.OrdinalIgnoreCase))
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "createorder",
                                                       "<script>alert('来源为订单的报价单不能再次生成订单');</script>"
                                                       );
                return;
            }

            string enqNo = quote.SourceNo;
            Order  ord   = new OrderDAL().GetOrderByEnq(enqNo);

            if (ord == null)
            {
                ord = Utility.GenerateOrder(quote);
            }
            ClientScript.RegisterClientScriptBlock(this.GetType(), "createorder",
                                                   string.Format("<script>window.open('orderform.aspx?ordid={0}&ordno={1}&sourceno={2}&sourcetype=Q')</script>",
                                                                 ord.Order_Id,
                                                                 ord.Order_No,
                                                                 ord.SourceNo));
        }
        protected void grdMain_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string strMsg = string.Empty;

            if (e.CommandName == "cmdedit")
            {
                Response.Redirect("Quotation.aspx?q=" + e.CommandArgument, true);
            }
            if (e.CommandName == "cmddelete")
            {
                Int64        UserIdno = Convert.ToInt64(Session["UserIdno"]);
                QuotationDAL obj      = new QuotationDAL();
                Int32        intValue = obj.DeleteQuotation(Convert.ToInt32(e.CommandArgument), UserIdno, ApplicationFunction.ConnectionString());
                obj = null;
                if (intValue > 0)
                {
                    this.BindGrid();
                    strMsg = "Record deleted successfully.";
                    txtQutNo.Focus();
                }
                else
                {
                    if (intValue == -1)
                    {
                        strMsg = "Record can not be deleted. It is in use.";
                    }
                    else
                    {
                        strMsg = "Record not deleted.";
                    }
                }
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alertstrMsg", "PassMessage('" + strMsg + "')", true);
            }
        }
Beispiel #4
0
        private List <Quotation> GetQuoteList()
        {
            string   quono       = txtQuotationNo.Text;
            string   quoman      = Utility.GetSelectedText(ddlQuoteMan);
            string   enqOrdMan   = Utility.GetSelectedText(ddlEnqOrdMan);
            string   status      = Utility.GetSelectedText(ddlQuotationStatus);
            DateTime beginDate   = string.IsNullOrEmpty(txtBeginDate.Text) ? DateTime.MinValue : DateTime.Parse(txtBeginDate.Text);
            DateTime endDate     = string.IsNullOrEmpty(txtEndDate.Text) ? DateTime.MaxValue : DateTime.Parse(txtEndDate.Text);
            string   companyName = Utility.GetSelectedText(ddlCompany);
            string   contcat     = Utility.GetSelectedText(ddlContact);
            string   email       = txtEmail.Text;
            string   phone       = txtPhone.Text;
            string   qq          = txtQQ.Text;

            QuotationDAL dal    = new QuotationDAL();
            var          quotes = dal.SearchQuote(quono,
                                                  quoman,
                                                  enqOrdMan,
                                                  status,
                                                  beginDate,
                                                  endDate,
                                                  companyName,
                                                  contcat,
                                                  email,
                                                  phone,
                                                  qq);

            return(quotes);
        }
        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();
        }
Beispiel #6
0
        public static void Init()
        {
            List <Quotation> quotations = QuotationDAL.Get();

            foreach (var item in quotations)
            {
                quotationDic[item.InstrumentID] = item;
            }
        }
Beispiel #7
0
        protected void btnGenerateFormalQuoation_Click(object sender, EventArgs e)
        {
            string       quono = GetQueryStringValue("quono");
            QuotationDAL dal   = new QuotationDAL();
            var          quote = dal.GetQuoteByNo(quono);

            quote.Status = "报价完成";
            SetControlsStatus(false);
            SetControlEnabled(btnChangeStatus, true);
        }
        public void Countall()
        {
            QuotationDAL objQuotation = new QuotationDAL();
            Int64        count        = objQuotation.Countall();

            if (count > 0)
            {
                lblTotalRecord.Text = "T. Record (s):" + count;
            }
            else
            {
                lblTotalRecord.Text = "T. Record (s): 0 ";
            }
        }
Beispiel #9
0
        protected void btnChangeStatus_Click(object sender, EventArgs e)
        {
            string       quono = GetQueryStringValue("quono");
            QuotationDAL dal   = new QuotationDAL();
            var          quote = dal.GetQuoteByNo(quono);

            AddFollowUp(followUpControl, quote.Status, Utility.GetSelectedText(ddlQuotationStatus));
            quote.Status = Utility.GetSelectedText(ddlQuotationStatus);
            dal.Save();
            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;
            }
        }
        protected void rpEnqList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Enquiry      enq  = e.Item.DataItem as Enquiry;
                RefineDAL    rDal = new RefineDAL();
                SurveyDAL    sDal = new SurveyDAL();
                QuotationDAL qDal = new QuotationDAL();

                Repeater rpRefinement = e.Item.FindControl("rpRefinement") as Repeater;
                Utility.BindDataToRepeater(rpRefinement, rDal.GetRefineBySource(SysConst.SourceTypeEnquiry, enq.Enquiry_No));

                Repeater rpSurvey = e.Item.FindControl("rpSurvey") as Repeater;
                Utility.BindDataToRepeater(rpSurvey, sDal.GetSurveyBySource(enq.Enquiry_No, SysConst.SourceTypeEnquiry));

                Repeater rpQuoationa = e.Item.FindControl("rpQuoation") as Repeater;
                Utility.BindDataToRepeater(rpQuoationa, qDal.GetQuotesBySource(SysConst.SourceTypeEnquiry, enq.Enquiry_No));

                FollowUpTop3UserControl followUp = e.Item.FindControl("followUpTop3UserControl") as FollowUpTop3UserControl;
                UIUtility.BindUserControl(followUp, SysConst.SourceTypeEnquiry, ((Enquiry)e.Item.DataItem).Enquiry_No);
            }
        }
 public QuotationController(QuotationDAL quotationDAL)
 {
     this.quotationDAL = quotationDAL;
 }
Beispiel #12
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);
                }
            }
        }
Beispiel #13
0
 public QuotationBO()
 {
     quotationDAL = new QuotationDAL();
 }
Beispiel #14
0
 public static int UpdateAllData(int QuotationID, string Notes, string QuotationNumber)
 {
     return(QuotationDAL.UpdateAllData(QuotationID, Notes, QuotationNumber));
 }
Beispiel #15
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);
                    }
                }
            }
        }
Beispiel #16
0
 public static int SaveService(QuotationServicesModel model)
 {
     return(QuotationDAL.SaveService(model));
 }
Beispiel #17
0
        public static List <QuotationModel> SelectQuotationByQuotationId(Guid ParlourId, int PageSize, int PageNum, string Keyword, string SortBy, string SortOrder)
        {
            SqlDataReader dr = QuotationDAL.SelectAllByParlourId(ParlourId, PageSize, PageNum, Keyword, SortBy, SortOrder);

            return(FuneralHelper.DataReaderMapToList <QuotationModel>(dr));
        }
Beispiel #18
0
        public static List <QuotationServicesModel> SelectServiceByQoutationID(int QuotationID)
        {
            SqlDataReader dr = QuotationDAL.SelectServiceByQoutationID(QuotationID);

            return(FuneralHelper.DataReaderMapToList <QuotationServicesModel>(dr));
        }
Beispiel #19
0
        public static QuotationModel SelectQuotationByQuotationId(int ID, Guid ParlourId)
        {
            SqlDataReader dr = QuotationDAL.SelectQuotationByQuotationId(ID, ParlourId);

            return(FuneralHelper.DataReaderMapToList <QuotationModel>(dr).FirstOrDefault());
        }
Beispiel #20
0
 public QuotationBLL(DBHelper _dbHelper)
     : base(_dbHelper)
 {
     quotationDAL = new QuotationDAL(_dbHelper);
 }
Beispiel #21
0
 public static int DeleteServiceByID(int pkiQuotationSelectionID)
 {
     return(QuotationDAL.DeleteServiceByID(pkiQuotationSelectionID));
 }
Beispiel #22
0
 public static int SaveDiscountAndAmount(QuotationDiscountModel model)
 {
     return(QuotationDAL.SaveDiscountAndAmount(model));
 }
Beispiel #23
0
        public static List <QuotationServicesModel> GetAllQuotationServices(Guid ParlourId)
        {
            SqlDataReader dr = QuotationDAL.GetAllQuotationServices(ParlourId);

            return(FuneralHelper.DataReaderMapToList <QuotationServicesModel>(dr));
        }
Beispiel #24
0
        protected void btnCopy_Click(object sender, EventArgs e)
        {
            string       quono       = GetQueryStringValue("quono");
            QuotationDAL dal         = new QuotationDAL();
            var          sourceQuote = dal.GetQuoteByNo(quono);

            Quotation targetQuote = new Quotation();
            SeedDAL   sdal        = new SeedDAL();
            var       quoteNo     = sdal.GetNoByTableName(SysConst.TableNameQuotation, SysConst.SuffixQuotation);

            targetQuote.Quotation_No                  = quoteNo;
            targetQuote.SourceNo                      = sourceQuote.SourceNo;
            targetQuote.SourceType                    = sourceQuote.SourceType;
            targetQuote.CADRefinementIntro            = sourceQuote.CADRefinementIntro;
            targetQuote.CreatedDate                   = sourceQuote.CreatedDate;
            targetQuote.CustomerAddress               = sourceQuote.CustomerAddress;
            targetQuote.CustomerCompanyName           = sourceQuote.CustomerCompanyName;
            targetQuote.CustomerContactName           = sourceQuote.CustomerContactName;
            targetQuote.CustomerEmail                 = sourceQuote.CustomerEmail;
            targetQuote.CustomerOthers                = sourceQuote.CustomerOthers;
            targetQuote.CustomerPhone1                = sourceQuote.CustomerPhone1;
            targetQuote.CustomerPhone2                = sourceQuote.CustomerPhone2;
            targetQuote.CustomerQQ                    = sourceQuote.CustomerQQ;
            targetQuote.DeliveryIntro                 = sourceQuote.DeliveryIntro;
            targetQuote.DeliveryToAddress             = sourceQuote.DeliveryToAddress;
            targetQuote.DeliveryType                  = sourceQuote.DeliveryType;
            targetQuote.InstallIntro                  = sourceQuote.InstallIntro;
            targetQuote.InstallType                   = sourceQuote.InstallType;
            targetQuote.IsCADNeedCustomerConfirmation = sourceQuote.IsCADNeedCustomerConfirmation;
            targetQuote.IsCADRefinementNeeded         = sourceQuote.IsCADRefinementNeeded;
            targetQuote.IsCustomerProvideImage        = sourceQuote.IsCustomerProvideImage;
            targetQuote.IsCustomerProvideSample       = sourceQuote.IsCustomerProvideSample;
            targetQuote.IsInstallProvided             = sourceQuote.IsInstallProvided;
            targetQuote.IsSampleProvidedToCustomer    = sourceQuote.IsSampleProvidedToCustomer;
            targetQuote.IsSurveyNeeded                = sourceQuote.IsSurveyNeeded;
            targetQuote.QuotationIntro                = sourceQuote.QuotationIntro;
            targetQuote.QuotationMan                  = sourceQuote.QuotationMan;
            targetQuote.Status      = FirstStatusConsts.Order;
            targetQuote.SurveyIntro = sourceQuote.SurveyIntro;
            targetQuote.SurveyType  = sourceQuote.SurveyType;

            dal.AddQuote(targetQuote);
            dal.Save();

            LineItemDAL lDal  = new LineItemDAL();
            var         items = lDal.GetLineItemsBySource(sourceQuote.Quotation_Id, SysConst.SourceTypeQuote);

            foreach (var item in items)
            {
                var targetQuoteItem = new LineItem()
                {
                    Intro      = item.Intro,
                    Name       = item.Name,
                    Project    = item.Project,
                    Quantity   = item.Quantity,
                    Remark     = item.Remark,
                    SourceId   = targetQuote.Quotation_Id,
                    SourceType = SysConst.SourceTypeQuote,
                    Spec       = item.Spec,
                    Unit       = item.Unit,
                    UnitPrice  = item.UnitPrice
                };

                lDal.AddLineItem(targetQuoteItem);
            }
            lDal.Save();

            //intro
            Utility.AddDefault(targetQuote.Quotation_No, SysConst.SourceTypeQuote, FooterConsts.Quotation);
            ClientScript.RegisterClientScriptBlock(this.GetType(), "copyquote",
                                                   string.Format("<script>window.open('quotationform.aspx?quoid={0}&quono={1}&sourceno={2}&sourcetype={3}')</script>",
                                                                 targetQuote.Quotation_Id,
                                                                 targetQuote.Quotation_No,
                                                                 targetQuote.SourceNo,
                                                                 targetQuote.SourceType));
        }
Beispiel #25
0
        public static List <QuotationModel> GetQuotationNumberByID(Guid ParlourId)
        {
            SqlDataReader dr = QuotationDAL.GetQuotationNumberByID(ParlourId);

            return(FuneralHelper.DataReaderMapToList <QuotationModel>(dr));
        }
Beispiel #26
0
        public static QuotationServicesModel GetServiceByID(int ID)
        {
            SqlDataReader dr = QuotationDAL.GetServiceByID(ID);

            return(FuneralHelper.DataReaderMapToList <QuotationServicesModel>(dr).FirstOrDefault());
        }
        private void BindGrid()
        {
            QuotationDAL objclsCityMaster = new QuotationDAL();
            DateTime?    dtfrom           = null;
            DateTime?    dtto             = null;
            Int64        yearIDNO         = Convert.ToInt32(ddlDateRange.SelectedValue);
            int          QuNo             = string.IsNullOrEmpty(Convert.ToString(txtQutNo.Text)) ? 0 : Convert.ToInt32(txtQutNo.Text);

            if (string.IsNullOrEmpty(Convert.ToString(txtQutnDatefrom.Text)) == false)
            {
                dtfrom = Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtQutnDatefrom.Text));
            }
            if (string.IsNullOrEmpty(Convert.ToString(txtQutnDatefrom.Text)) == false)
            {
                dtto = Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtQutnDateto.Text));
            }
            int   citto    = Convert.ToInt32(drpCityTo.SelectedValue);
            int   cityfrom = Convert.ToInt32(drpCityFrom.SelectedValue);
            int   citydel  = Convert.ToInt32(drpCityDelivery.SelectedValue);
            int   sender   = Convert.ToInt32(drpSender.SelectedValue == "" ? 0 : Convert.ToInt32(drpSender.SelectedValue));
            Int32 yearidno = Convert.ToInt32(ddlDateRange.SelectedValue == "" ? 0 : Convert.ToInt32(ddlDateRange.SelectedValue));
            Int64 UserIdno = 0;

            if (Convert.ToString(Session["Userclass"]) != "Admin")
            {
                UserIdno = Convert.ToInt64(Session["UserIdno"]);
            }
            var lstGridData = objclsCityMaster.SelectQuotation(QuNo, dtfrom, dtto, cityfrom, citydel, citto, sender, yearidno, UserIdno);

            objclsCityMaster = null;
            if (lstGridData != null && lstGridData.Count > 0)
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("Sr No.", typeof(string));
                dt.Columns.Add("Quatation No.", typeof(string));
                dt.Columns.Add("Date", typeof(string));
                dt.Columns.Add("From City", typeof(string));
                dt.Columns.Add("City To", typeof(string));
                dt.Columns.Add("Delivery Place", typeof(string));
                dt.Columns.Add("Sender", typeof(string));
                dt.Columns.Add("Net Amount", typeof(string));

                double TNet = 0;
                for (int i = 0; i < lstGridData.Count; i++)
                {
                    DataRow dr = dt.NewRow();
                    dr["Sr No."]         = Convert.ToString(i + 1);
                    dr["Quatation No."]  = Convert.ToString(DataBinder.Eval(lstGridData[i], "QuHead_No"));
                    dr["Date"]           = Convert.ToDateTime(DataBinder.Eval(lstGridData[i], "QuHead_Date")).ToString("dd-MM-yyyy");
                    dr["From City"]      = Convert.ToString(DataBinder.Eval(lstGridData[i], "CityFrom"));
                    dr["City To"]        = Convert.ToString(DataBinder.Eval(lstGridData[i], "CityTo"));
                    dr["Delivery Place"] = Convert.ToString(DataBinder.Eval(lstGridData[i], "CityDely"));
                    dr["Sender"]         = Convert.ToString(DataBinder.Eval(lstGridData[i], "Sender"));
                    dr["Net Amount"]     = Convert.ToDouble(DataBinder.Eval(lstGridData[i], "Net_Amnt")).ToString("N2");
                    dt.Rows.Add(dr);

                    TNet += Convert.ToDouble(DataBinder.Eval(lstGridData[i], "Net_Amnt"));
                    if (i == lstGridData.Count - 1)
                    {
                        DataRow drr = dt.NewRow();
                        drr["Sender"]     = "Total";
                        drr["Net Amount"] = (TNet).ToString("N2");
                        dt.Rows.Add(drr);
                    }
                }
                if (dt != null && dt.Rows.Count > 0)
                {
                    ViewState["Dt"] = dt;
                }
                //
                Double TotalNetAmount = 0;

                for (int i = 0; i < lstGridData.Count; i++)
                {
                    TotalNetAmount += Convert.ToDouble(DataBinder.Eval(lstGridData[i], "Net_Amnt"));
                }
                lblNetTotalAmount.Text = TotalNetAmount.ToString("N2");

                grdMain.DataSource = lstGridData;
                grdMain.DataBind();
                lblTotalRecord.Text = "Total Record (s): " + lstGridData.Count;
                grdprint.DataSource = lstGridData;
                grdprint.DataBind();

                int startRowOnPage = (grdMain.PageIndex * grdMain.PageSize) + 1;
                int lastRowOnPage  = startRowOnPage + grdMain.Rows.Count - 1;
                lblcontant.Text     = "Showing " + startRowOnPage.ToString() + " - " + lastRowOnPage.ToString() + " of " + lstGridData.Count.ToString();
                lblcontant.Visible  = true;
                imgBtnExcel.Visible = true;
                divpaging.Visible   = true;
            }
            else
            {
                grdMain.DataSource = null;
                grdMain.DataBind();
                lblTotalRecord.Text = "Total Record (s): 0 ";
                grdprint.DataSource = null;
                grdprint.DataBind();
                imgBtnExcel.Visible = false;
                lblcontant.Visible  = false;
                divpaging.Visible   = false;
            }
        }
Beispiel #28
0
        public static QuotationModel GetQuotationNumberByID2(Guid ParlourId)
        {
            SqlDataReader dr = QuotationDAL.GetQuotationNumberByID2(ParlourId);

            return(FuneralHelper.DataReaderMapToList <QuotationModel>(dr).FirstOrDefault());
        }
Beispiel #29
0
        protected void btnCreateQuotation_Click(object sender, EventArgs e)
        {
            //get no
            SeedDAL sdal = new SeedDAL();
            string  no   = sdal.GetNoByTableName(SysConst.TableNameQuotation, SysConst.SuffixQuotation);
            //get enqordman
            string          enqOrdMan               = string.Empty;
            string          companyName             = string.Empty;
            string          contact                 = string.Empty;
            string          address                 = string.Empty;
            string          email                   = string.Empty;
            string          qq                      = string.Empty;
            string          phone1                  = string.Empty;
            string          phone2                  = string.Empty;
            string          other                   = string.Empty;
            bool            isSampleToCustomer      = false;
            bool            isSampleFromCustomer    = false;
            bool            isCustomerProvideImg    = false;
            bool            isSurveyNeed            = false;
            string          surveyType              = string.Empty;
            string          surveyIntro             = string.Empty;
            bool            isCADRefineNeeded       = false;
            string          refineIntro             = string.Empty;
            bool            isCustomerConfirmNeeded = false;
            string          deliveryType            = string.Empty;
            string          deliveryIntro           = string.Empty;
            string          deliveryAdd             = string.Empty;
            bool            isInstallProvided       = false;
            string          installType             = string.Empty;
            string          insallIntro             = string.Empty;
            string          enqNo                   = string.Empty;
            List <LineItem> items                   = new List <LineItem>();
            int             sourceId                = -1;

            if (string.Equals(SourceType, SysConst.SourceTypeSalesOrder, StringComparison.OrdinalIgnoreCase))
            {
                OrderDAL soDAL = new OrderDAL();
                var      so    = soDAL.GetOrderByNo(SourceNo);
                so.Status = "申请报价";
                soDAL.Save();
                OnQuotationCreated(so.Status, EventArgs.Empty);
                enqOrdMan               = so.OrderMan;
                companyName             = so.CustomerCompanyName;
                contact                 = so.CustomerContactName;
                address                 = so.CustomerAddress;
                email                   = so.CustomerEmail;
                qq                      = so.CustomerQQ;
                phone1                  = so.CustomerPhone1;
                phone2                  = so.CustomerPhone2;
                other                   = so.CustomerOthers;
                isSampleToCustomer      = so.IsSampleProvidedToCustomer;
                isSampleFromCustomer    = so.IsCustomerProvideSample;
                isCustomerProvideImg    = so.IsCustomerProvideImage;
                isSurveyNeed            = so.IsSurveyNeeded;
                surveyType              = so.SurveyType;
                surveyIntro             = so.SurveyIntro;
                isCADRefineNeeded       = so.IsCADRefinementNeeded;
                refineIntro             = so.CADRefinementIntro;
                isCustomerConfirmNeeded = so.IsCADNeedCustomerConfirmation;
                deliveryType            = so.DeliveryType;
                deliveryIntro           = so.DeliveryIntro;
                deliveryAdd             = so.DeliveryToAddress;
                isInstallProvided       = so.IsInstallProvided;
                installType             = string.IsNullOrEmpty(so.InstallType) ?string.Empty : so.InstallType;
                insallIntro             = so.InstallIntro;
                enqNo                   = so.EnqNo;
                sourceId                = so.Order_Id;
            }
            else if (string.Equals(SourceType, SysConst.SourceTypeEnquiry, StringComparison.OrdinalIgnoreCase))
            {
                EnquiryDAL enqDAL = new EnquiryDAL();
                var        enq    = enqDAL.GetEnquiryByNo(SourceNo);
                enqOrdMan               = enq.EnqMan;
                companyName             = enq.CustomerCompanyName;
                contact                 = enq.CustomerContactName;
                address                 = enq.CustomerAddress;
                email                   = enq.CustomerEmail;
                qq                      = enq.CustomerQQ;
                phone1                  = enq.CustomerPhone1;
                phone2                  = enq.CustomerPhone2;
                other                   = enq.CustomerOthers;
                isSampleToCustomer      = enq.IsSampleProvidedToCustomer;
                isSampleFromCustomer    = enq.IsCustomerProvideSample;
                isCustomerProvideImg    = enq.IsCustomerProvideImage;
                isSurveyNeed            = enq.IsSurveyNeeded;
                surveyType              = enq.SurveyType;
                surveyIntro             = enq.SurveyIntro;
                isCADRefineNeeded       = enq.IsCADRefinementNeeded;
                refineIntro             = enq.CADRefinementIntro;
                isCustomerConfirmNeeded = enq.IsCADNeedCustomerConfirmation;
                deliveryType            = enq.DeliveryType;
                deliveryIntro           = enq.DeliveryIntro;
                deliveryAdd             = enq.DeliveryToAddress;
                isInstallProvided       = enq.IsInstallProvided;
                installType             = string.IsNullOrEmpty(enq.InstallType) ? string.Empty : enq.InstallType;
                insallIntro             = enq.InstallIntro;
                enqNo                   = SourceNo;
                sourceId                = enq.Enquiry_Id;
                //update enq status
                enq.Status = "申请报价";
                enqDAL.Save();
            }

            //new quote
            QuotationDAL dal   = new QuotationDAL();
            Quotation    quote = new Quotation()
            {
                Quotation_No                  = no,
                Status                        = FirstStatusConsts.Quotation,
                EnqOrdMan                     = enqOrdMan,
                SourceType                    = SourceType,
                SourceNo                      = SourceNo,
                CreatedDate                   = DateTime.Now,
                CreatedAt                     = DateTime.Now,
                CreatedBy                     = SMSContext.Current.User.UserName,
                CustomerCompanyName           = companyName,
                CustomerContactName           = contact,
                CustomerAddress               = address,
                CustomerEmail                 = email,
                CustomerQQ                    = qq,
                CustomerPhone1                = phone1,
                CustomerPhone2                = phone2,
                CustomerOthers                = other,
                IsSampleProvidedToCustomer    = isSampleToCustomer,
                IsCustomerProvideSample       = isSampleFromCustomer,
                IsCustomerProvideImage        = isCustomerProvideImg,
                IsSurveyNeeded                = isSurveyNeed,
                SurveyType                    = surveyType,
                SurveyIntro                   = surveyIntro,
                IsCADRefinementNeeded         = isCADRefineNeeded,
                CADRefinementIntro            = refineIntro,
                IsCADNeedCustomerConfirmation = isCustomerConfirmNeeded,
                DeliveryType                  = deliveryType,
                DeliveryIntro                 = deliveryIntro,
                DeliveryToAddress             = deliveryAdd,
                IsInstallProvided             = isInstallProvided,
                InstallType                   = installType,
                InstallIntro                  = insallIntro,
                EnqNo = enqNo
            };

            dal.AddQuote(quote);
            dal.Save();

            LineItemDAL lDAL = new LineItemDAL();

            items = lDAL.GetLineItemsBySource(sourceId, SourceType);
            foreach (var item in items)
            {
                LineItem target = new LineItem()
                {
                    Intro      = item.Intro,
                    Name       = item.Name,
                    OriginNo   = item.OriginNo,
                    Project    = item.Project,
                    Quantity   = item.Quantity,
                    Remark     = item.Remark,
                    SourceId   = quote.Quotation_Id,
                    SourceType = SysConst.SourceTypeQuote,
                    Spec       = item.Spec,
                    Unit       = item.Unit,
                    UnitPrice  = item.UnitPrice
                };
                lDAL.AddLineItem(target);
            }
            lDAL.Save();

            int    quoId = quote.Quotation_Id;
            string quoNo = quote.Quotation_No;

            Utility.AddDefault(quote.Quotation_No, SysConst.SourceTypeQuote, FooterConsts.Quotation);
            string url    = Page.ResolveUrl(string.Format("~/QuotationForm.aspx?quoid={0}&quono={1}&sourcetype={2}&sourceno={3}", quoId, quoNo, SourceType, SourceNo));
            string script = string.Format("<script>window.open('{0}')</script>", url);

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "createquote", script);
            BindControl();
            SetFocus(btnCreateQuotation);
        }
Beispiel #30
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string       quono = GetQueryStringValue("quono");
            QuotationDAL dal   = new QuotationDAL();
            var          quote = dal.GetQuoteByNo(quono);

            if (!string.IsNullOrEmpty(txtCreatedDate.Text))
            {
                quote.CreatedDate = DateTime.Parse(txtCreatedDate.Text);
            }
            quote.EnqOrdMan                  = Utility.GetSelectedText(ddlEnqOrdMan);
            quote.QuotationMan               = Utility.GetSelectedText(ddlQuoteMan);
            quote.QuotationIntro             = txtQuoteIntro.Text;
            quote.CustomerCompanyName        = customerInfoControl.CompanyName;
            quote.CustomerContactName        = customerInfoControl.ContactName;
            quote.CustomerAddress            = customerInfoControl.Address;
            quote.CustomerEmail              = customerInfoControl.Email;
            quote.CustomerQQ                 = customerInfoControl.QQ;
            quote.CustomerPhone1             = customerInfoControl.Phone1;
            quote.CustomerPhone2             = customerInfoControl.Phone2;
            quote.CustomerOthers             = customerInfoControl.Other;
            quote.IsSampleProvidedToCustomer = SampleControl1.IsSampleProvidedToCustomer;
            quote.IsCustomerProvideSample    = SampleControl1.IsSampleFromCustomer;
            quote.IsCustomerProvideImage     = customerDrawingControl.IsCustomerProvideImage;
            quote.IsSurveyNeeded             = SurveyEditControl1.IsSurveyNeed;
            if (SurveyEditControl1.IsSurveyNeed)
            {
                quote.SurveyType  = SurveyEditControl1.SurveyType;
                quote.SurveyIntro = SurveyEditControl1.SurveyIntro;
            }
            quote.IsCADRefinementNeeded = CADEditControl1.IsCADRefinementNeeded;
            if (CADEditControl1.IsCADRefinementNeeded)
            {
                quote.CADRefinementIntro            = CADEditControl1.RefineIntro;
                quote.IsCADNeedCustomerConfirmation = CADEditControl1.IsCustomerCADConfirmationNeeded;
            }
            quote.DeliveryType      = DeliveryEditControl1.DeliveryType;
            quote.DeliveryIntro     = DeliveryEditControl1.DeliveryIntro;
            quote.DeliveryToAddress = DeliveryEditControl1.DeliveryToAddress;

            quote.IsInstallProvided = InstallEditControl1.IsInstallProvided;
            if (InstallEditControl1.IsInstallProvided)
            {
                quote.InstallType  = InstallEditControl1.InstallType;
                quote.InstallIntro = InstallEditControl1.InstallIntro;
            }
            AddFollowUp(followUpControl, quote.Status, Utility.GetSelectedText(ddlQuotationStatus));
            quote.Status = ddlQuotationStatus.SelectedItem.Text;
            dal.Save();
            //save new customer
            customerInfoControl.Save();
            this.SetFocus(btnSave);
            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);
                SetControlEnabled(ddlQuotationStatus, true);
                SetControlEnabled(btnChangeStatus, true);
                SetControlEnabled(btnCopy, true);
            }
        }