コード例 #1
0
        protected void gvItems_SelectedIndexChangedEx(object sender, EventArgs e)
        {
            PriceManager pM = new PriceManager();
            PricePointManager ppM = new PricePointManager();
            GeneralMemoConcessionDetailManager gMCDM = new GeneralMemoConcessionDetailManager();

            bool bResult = false;

            dtMarkdownList = (DataTable)Session["LIST"];
            var ItemFoundResult = (from myRow in dtMarkdownList.AsEnumerable()
                                   where myRow.Field<string>("STYLE #") == gvItems.SelectedRow.Cells[1].Text
                                   select myRow);

            if (ItemFoundResult.Count() > 0)
                bResult = true;
            else
            {
                dtNewMarkdownList = (DataTable)Session["NEWLIST"];
                ItemFoundResult = (from myRow in dtNewMarkdownList.AsEnumerable()
                                   where myRow.Field<string>("STYLE #") == gvItems.SelectedRow.Cells[1].Text
                                   select myRow);

                bResult = (ItemFoundResult.Count() > 0);
            }

            if (bResult == true)
            {
                this.lblDuplicateCount.Text = "{0} items found!";
                lblDuplicateCount.Text = string.Format(lblDuplicateCount.Text, 1);
                hfDuplicateStylePopupExtender.Show();
                txtCurrentPrice.Text = "";
                txtMarkDownPrice.Text = "0.00";
                return;
            }

            Double dResult = 0;
            //GET REGULAR PRICE
            dResult = Convert.ToDouble(pM.GetSRPByStyle(gvItems.SelectedRow.Cells[1].Text, DDLBrand.SelectedItem.Text).Price_2);
            lblPriceStatus.Text = "NEW";

            //GET MARKDOWN PRICE IF ANY
            PricePoint pPoint = new PricePoint();

            int GroupNo = -1;

            switch (rdioApplyPricePointTo.SelectedIndex)
            {
                case 0:
                    {
                        _GroupAreaMemoManager.GroupAreaMemo();
                        GroupNo = _GroupAreaMemoManager.GroupAreaMemoList[DDLAreaGroup.SelectedIndex].GroupNo;
                        if (GroupNo == 0)
                            GroupNo = 1;
                        else
                        {
                            if (GroupNo == 99)
                                GroupNo = 2;
                        }
                        break;
                    }
                case 1:
                    {
                        GroupNo = Convert.ToInt32(DDLSubArea.SelectedItem.Value);
                        break;
                    }
                case 2:
                    {
                        GroupNo = Convert.ToInt32(Session["CUSTOMER MD"]);
                        break;
                    }
            }

            pPoint = ppM.GetStyleCurrentPrice1(gvItems.SelectedRow.Cells[1].Text, DDLBrand.SelectedItem.Text,rdioApplyPricePointTo.SelectedValue.ToUpperInvariant(),GroupNo);
            if (pPoint != null)
            {
                dResult =  Convert.ToDouble(pPoint.Price);
                lblPriceStatus.Text = "MARKDOWN";
            }

            txtCurrentPrice.Text = string.Format("{0:0.00}",dResult);
            btnAddNewItem_ModalPopupExtender.Show();
        }
        protected void gvItems_SelectedIndexChangedEx(object sender, EventArgs e)
        {
            _GenMemoObj = (IRMS.Entities.GeneralMemoConcession)Session["GenMemoObject"];
            PriceManager pM = new PriceManager();
            PricePointManager ppM = new PricePointManager();

            dtMarkdownList = (DataTable)Session["LIST"]; ;
            var ItemFoundResult = (from myRow in dtMarkdownList.AsEnumerable()
                                   where myRow.Field<string>("STYLE #") == gvItems.SelectedRow.Cells[1].Text
                                   select myRow);

            if (ItemFoundResult.Count() > 0)
            {
                this.lblDuplicateCount.Text = "{0} items found!";
                lblDuplicateCount.Text = string.Format(lblDuplicateCount.Text, 1);
                hfDuplicateStylePopupExtender.Show();
                return;
            }

            Double dResult = 0;
            //GET REGULAR PRICE
            dResult = Convert.ToDouble(pM.GetSRPByStyle(gvItems.SelectedRow.Cells[1].Text, txtBrandName.Text).Price_2);
            lblPriceStatus.Text = "NEW";

            //GET MARKDOWN PRICE IF ANY
            PricePoint pPoint = new PricePoint();

            int GroupNo = -1;

            GroupNo = _GenMemoObj.GroupNumber;
            if (_GenMemoObj.PriceType == "AREA")
            {
                if (GroupNo == 0)
                    GroupNo = 1;
                else
                {
                    if (GroupNo == 99)
                        GroupNo = 2;
                }
            }

            pPoint = ppM.GetStyleCurrentPrice1(gvItems.SelectedRow.Cells[1].Text, txtBrandName.Text, _GenMemoObj.PriceType, GroupNo);

            //GET MARKDOWN PRICE IF ANY
            if (pPoint != null)
            {
                dResult = Convert.ToDouble(pPoint.Price);
                lblPriceStatus.Text = "MARKDOWN";
            }

            txtCurrentPrice.Text = string.Format("{0:0.00}", dResult);
            btnAddNewItem_ModalPopupExtender.Show();
        }