コード例 #1
0
    private void BindDropDown()
    {
        if ((int)ViewState["ID"] != 0)
        {
            ORD_ApplyPublish m = new ORD_ApplyPublishBLL((int)ViewState["ID"]).Model;
            ViewState["Type"] = m.Type;
        }

        if ((int)ViewState["Type"] == 1)
        {
            ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent IN (1,9)");
        }
        else
        {
            ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent='9'");
        }

        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("所有品牌", "0"));
        ddl_Brand.SelectedValue = "0";
        rbl_Brand_SelectedIndexChanged(null, null);

        DropDownList ddl_ProductBrand = (DropDownList)pl_ApplyPublish.FindControl("ORD_ApplyPublish_ProductBrand");

        if (ddl_ProductBrand != null)
        {
            ddl_ProductBrand.DataTextField  = "Name";
            ddl_ProductBrand.DataValueField = "ID";
            ddl_ProductBrand.DataSource     = PDT_BrandBLL.GetModelList("(IsOpponent IN (1) OR ID IN (4,5,99))");
            ddl_ProductBrand.DataBind();
            ddl_ProductBrand.Items.Insert(0, new ListItem("请选择", "0"));
            ddl_ProductBrand.SelectedValue = "0";
        }
    }
コード例 #2
0
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("");
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now).ToString();



        IList <PDT_Brand> _brandList = PDT_BrandBLL.GetModelList("(IsOpponent IN (1) OR ID IN (4,5))");
        ddl_Brand.DataTextField  = "Name";
        ddl_Brand.DataValueField = "ID";
        ddl_Brand.DataSource     = _brandList;
        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("全部", "0"));

        ddl_GiftClassify.DataSource = DictionaryBLL.GetDicCollections("ORD_GiftClassify");
        ddl_GiftClassify.DataBind();
        ddl_GiftClassify.Items.Insert(0, new ListItem("全部", "0"));
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["ID"] != null)
            {
                PDT_Product product = new PDT_ProductBLL(int.Parse(Request.QueryString["ID"])).Model;

                if (BindProduct(product))
                {
                    BindGrid();
                    select_ProductCode.Enabled = false;

                    if (product.Brand > 0)
                    {
                        PDT_Brand b = new PDT_BrandBLL(product.Brand).Model;
                        Header.Attributes["WebPageSubCode"] = "IsOpponent=" + b.IsOpponent;
                    }
                }
            }
            else
            {
                UploadFile1.Visible = false;
            }
        }
    }
コード例 #4
0
    private void BindDropDown()
    {
        DropDownList ddl_QNAProject = (DropDownList)pl_detail.FindControl("CAT_Activity_RelateQuestionnaire");

        if (ddl_QNAProject != null)
        {
            ddl_QNAProject.DataSource     = QNA_ProjectBLL.GetModelList("Classify = 3 AND Enabled='Y'");
            ddl_QNAProject.DataTextField  = "Name";
            ddl_QNAProject.DataValueField = "ID";
            ddl_QNAProject.DataBind();
            ddl_QNAProject.Items.Insert(0, new ListItem("请选择...", "0"));
        }
        IList <AC_AccountTitle> lists;

        if (ConfigHelper.GetConfigInt("ActivityFeeAccountTitle2") == 0)
        {
            lists = AC_AccountTitleBLL.GetListByFeeType(ConfigHelper.GetConfigInt("HDM-CATFeeType"));
        }
        else
        {
            lists = AC_AccountTitleBLL.GetModelList("(ID = 1 OR SuperID=" + ConfigHelper.GetConfigString("ActivityFeeAccountTitle2") + ") AND MCS_SYS.dbo.UF_Spilt2('MCS_Pub.dbo.AC_AccountTitle',ExtPropertys,'IsDisable')<>'Y'");
        }
        ddl_AccountTitle.DataSource = lists;
        ddl_AccountTitle.DataBind();

        ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent=1");
        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("请选择...", "0"));
    }
コード例 #5
0
    private void BindDropdown()
    {
        //获取品牌
        if ((int)Session["OwnerType"] == 1)
        {
            ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("");
        }
        else if ((int)Session["OwnerType"] == 2)
        {
            ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent=1");
        }
        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("所有", "0"));
        if ((int)ViewState["Brand"] > 0)
        {
            ddl_Brand.SelectedValue = ViewState["Brand"].ToString();
        }

        rbl_ApproveFlag.DataSource = DictionaryBLL.GetDicCollections("PUB_ApproveFlag");
        rbl_ApproveFlag.DataBind();
        rbl_ApproveFlag.Items.Insert(0, new ListItem("所有", "0"));
        rbl_ApproveFlag.SelectedValue = "0";

        rbl_State.DataSource = DictionaryBLL.GetDicCollections("PDT_State");
        rbl_State.DataBind();
        rbl_State.SelectedValue = "1";
    }
コード例 #6
0
    private void BindDropDown()
    {
        #region 绑定产品列表
        cbl_Brand.DataTextField  = "Name";
        cbl_Brand.DataValueField = "ID";
        cbl_Brand.DataSource     = PDT_BrandBLL.GetModelList("IsOpponent=1");
        cbl_Brand.DataBind();
        if ((int)ViewState["Brand"] == 0)
        {
            cbx_CheckAll.Checked = true;
            cbx_CheckAll_CheckedChanged(null, null);
        }
        else
        {
            cbl_Brand.Items.FindByValue(ViewState["Brand"].ToString()).Selected = true;
            cbx_CheckAll.Enabled = false;
            cbl_Brand.Enabled    = false;
        }
        #endregion

        #region 最迟允许核销月份
        int lastmonth = ConfigHelper.GetConfigInt("LastWriteOffMonth");
        if (lastmonth == 0)
        {
            lastmonth = 3;
        }
        ddl_LastWriteOffMonth.DataSource = AC_AccountMonthBLL.GetModelList("ID>" +
                                                                           ViewState["AccountMonth"].ToString() + "AND ID<=" +
                                                                           ((int)ViewState["AccountMonth"] + lastmonth).ToString());
        ddl_LastWriteOffMonth.DataBind();
        #endregion
    }
コード例 #7
0
    private void BindDropDown()
    {
        #region 绑定用户可管辖的片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_Month.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate<GETDATE() AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_Month.DataBind();
        ddl_Month.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now).ToString();

        ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent =" + rbl_IsOpponent.SelectedValue);
        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("所有品牌", "0"));
        ddl_Brand.SelectedValue = "0";
        rbl_Brand_SelectedIndexChanged(null, null);
    }
コード例 #8
0
 private void BindDropDown()
 {
     if (ViewState["IsCXP"] == null)
     {
         ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent in('1','9')");
     }
     else
     {
         if ((bool)ViewState["IsCXP"])
         {
             ddl_Brand.DataSource     = PDT_BrandBLL.GetModelList("IsOpponent in('9')");
             select_Product.PageUrl  += "?IsOpponent=9";
             select_Product1.PageUrl += "?IsOpponent=9";
         }
         else
         {
             ddl_Brand.DataSource     = PDT_BrandBLL.GetModelList("IsOpponent in('1')");
             select_Product.PageUrl  += "?IsOpponent=1";
             select_Product1.PageUrl += "?IsOpponent=1";
         }
     }
     ddl_Brand.DataBind();
     ddl_Brand.Items.Insert(0, new ListItem("所有品牌", "0"));
     ddl_Brand_SelectedIndexChanged(null, null);
 }
コード例 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["ID"] != null)
            {
                PDT_Product product = new PDT_ProductBLL(int.Parse(Request.QueryString["ID"])).Model;

                if (BindProduct(product))
                {
                    BindGrid();
                    select_ProductCode.Enabled = false;

                    if (product.Brand > 0)
                    {
                        PDT_Brand b = new PDT_BrandBLL(product.Brand).Model;
                        Header.Attributes["WebPageSubCode"] = "IsOpponent=" + b.IsOpponent;
                    }
                }
            }
            else
            {
                UploadFile1.Visible = false;
            }
        }
    }
コード例 #10
0
    private void BindDropdown()
    {
        #region 绑定用户可管辖的片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_AccountMonth.DataSource = AC_AccountMonthBLL.GetModelList("");
        ddl_AccountMonth.DataBind();
        ddl_AccountMonth.SelectedValue = (AC_AccountMonthBLL.GetCurrentMonth()).ToString();

        IList <PDT_Brand> _brandList = PDT_BrandBLL.GetModelList("IsOpponent=1");
        ddl_Brand.DataTextField  = "Name";
        ddl_Brand.DataValueField = "ID";
        ddl_Brand.DataSource     = _brandList;
        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("全部", "0"));
        ddl_Classify.Items.Insert(0, new ListItem("所有", "0"));
    }
コード例 #11
0
    private void BindDropDown()
    {
        ddl_JournalType.DataSource = DictionaryBLL.GetDicCollections("OA_JournalType");
        ddl_JournalType.DataBind();

        ddl_WorkingClassify.DataSource = DictionaryBLL.GetDicCollections("OA_WorkingClassify");
        ddl_WorkingClassify.DataBind();
        ddl_WorkingClassify.Items.Insert(0, new ListItem("请选择...", "0"));

        for (int i = 0; i < 24; i++)
        {
            ddl_BeginHour.Items.Add(new ListItem(i.ToString("d2"), i.ToString("d2")));
            ddl_EndHour.Items.Add(new ListItem(i.ToString("d2"), i.ToString("d2")));
        }
        ddl_BeginHour.SelectedValue = "08";
        ddl_EndHour.SelectedValue   = "17";

        DropDownList ddl_OpponentBrand1 = (DropDownList)pl_detail.FindControl("JN_Journal_OpponentBrand1");

        ddl_OpponentBrand1.DataTextField  = "Name";
        ddl_OpponentBrand1.DataValueField = "ID";
        ddl_OpponentBrand1.DataSource     = PDT_BrandBLL.GetModelList("IsOpponent=2");
        ddl_OpponentBrand1.DataBind();
        ddl_OpponentBrand1.Items.Insert(0, new ListItem("请选择...", "0"));

        DropDownList ddl_OpponentBrand2 = (DropDownList)pl_detail.FindControl("JN_Journal_OpponentBrand2");

        ddl_OpponentBrand2.DataTextField  = "Name";
        ddl_OpponentBrand2.DataValueField = "ID";
        ddl_OpponentBrand2.DataSource     = PDT_BrandBLL.GetModelList("IsOpponent=2");
        ddl_OpponentBrand2.DataBind();
        ddl_OpponentBrand2.Items.Insert(0, new ListItem("请选择...", "0"));
    }
コード例 #12
0
    protected string GetPDTBrandName(int product)
    {
        PDT_Product p = new PDT_ProductBLL(product, true).Model;
        PDT_Brand b = new PDT_BrandBLL(p.Brand).Model;

        if (b != null)
            return b.Name;
        else
            return "";
    }
コード例 #13
0
    protected void rbl_IsOpponent_SelectedIndexChanged(object sender, EventArgs e)
    {
        ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent =" + rbl_IsOpponent.SelectedValue);
        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("所有品牌", "0"));
        ddl_Brand.SelectedValue = "0";
        rbl_Brand_SelectedIndexChanged(null, null);

        gv_List.PageIndex = 0;
        BindGrid();
    }
コード例 #14
0
    private void BindDropdown()
    {
        //获取品牌
        ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent=" + ViewState["IsOpponent"].ToString());
        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("所有", "0"));

        rbl_ApproveFlag.DataSource = DictionaryBLL.GetDicCollections("PUB_ApproveFlag");
        rbl_ApproveFlag.DataBind();
        rbl_ApproveFlag.Items.Insert(0, new ListItem("所有", "0"));
        rbl_ApproveFlag.SelectedValue = "0";
    }
コード例 #15
0
    protected void bt_AddProduct_Click(object sender, EventArgs e)
    {
        int product = 0;

        if (int.TryParse(select_Product.SelectValue, out product) && product > 0)
        {
            PDT_Product pdt = new PDT_ProductBLL(product).Model;
            if (pdt == null)
            {
                return;
            }

            int quantity = int.Parse(tbx_Q1.Text) * pdt.ConvertFactor + int.Parse(tbx_Q2.Text);

            DataTable dt  = (DataTable)ViewState["DTDetail"];
            DataRow[] drs = dt.Select("ID=" + product.ToString());
            if (drs.Length > 0)
            {
                drs[0]["Quantity"] = quantity;
            }
            else
            {
                DataRow dr = dt.NewRow();

                decimal factoryprice = 0, price = 0;
                PDT_ProductPriceBLL.GetPriceByClientAndType((int)ViewState["ClientID"], product, (int)ViewState["Type"], out factoryprice, out price);

                dr["ID"]            = product;
                dr["Code"]          = pdt.Code;
                dr["FullName"]      = pdt.FullName;
                dr["ShortName"]     = pdt.ShortName;
                dr["Brand"]         = pdt.Brand;
                dr["Spec"]          = pdt["Spec"];
                dr["Classify"]      = pdt.Classify;
                dr["ConvertFactor"] = pdt.ConvertFactor;
                dr["FactoryPrice"]  = factoryprice;
                dr["Price"]         = price;
                dr["Quantity"]      = quantity;

                try
                {
                    dr["BrandName"]        = new PDT_BrandBLL(pdt.Brand).Model.Name;
                    dr["ClassifyName"]     = new PDT_ClassifyBLL(pdt.Classify).Model.Name;
                    dr["TrafficPackaging"] = DictionaryBLL.GetDicCollections("PDT_Packaging")[pdt.TrafficPackaging.ToString()].Name;
                    dr["Packaging"]        = DictionaryBLL.GetDicCollections("PDT_Packaging")[pdt.Packaging.ToString()].Name;
                }
                catch { }

                dt.Rows.Add(dr);
            }
            BindGrid();
        }
    }
コード例 #16
0
    private void BindTree()
    {
        //获取品牌
        string condition = "";

        if (Request.QueryString["IsOpponent"] != null)
        {
            condition = "IsOpponent=" + Request.QueryString["IsOpponent"];
        }

        IList <PDT_Brand> _brands = PDT_BrandBLL.GetModelList(condition);

        dl_brand.DataSource = _brands;
        dl_brand.DataBind();
        dl_brand.Items.Insert(0, new ListItem("请选择", "0"));
        dl_brand_SelectedIndexChanged(null, null);

        foreach (PDT_Brand brand in _brands)
        {
            TreeNode tn_brand = new TreeNode(brand.Name, brand.ID.ToString());
            tr_Product.Nodes.Add(tn_brand);
            IList <PDT_Classify> _classifys = new PDT_ClassifyBLL()._GetModelList("PDT_Classify.Brand=" + brand.ID.ToString());
            foreach (PDT_Classify classify in _classifys)
            {
                TreeNode tn_classify = new TreeNode(classify.Name, classify.ID.ToString());
                tn_brand.ChildNodes.Add(tn_classify);

                string ConditionStr = "PDT_Product.State = 1 AND PDT_Product.Classify=" + classify.ID.ToString() + "and pdt_product.approveflag=1";
                if (Request.QueryString["ExtCondition"] != null)
                {
                    ConditionStr += " AND (" + Request.QueryString["ExtCondition"].Replace("\"", "").Replace('~', '\'') + ")";
                }

                IList <PDT_Product> _products = PDT_ProductBLL.GetModelList(ConditionStr);
                foreach (PDT_Product product in _products)
                {
                    TreeNode tn = new TreeNode();
                    tn.Text  = product.Code + "  " + product.FullName;
                    tn.Value = product.ID.ToString();
                    tn_classify.ChildNodes.Add(tn);

                    if (tn.Value == ViewState["ID"].ToString())
                    {
                        tn_classify.Expand();
                        tn.Select();
                        tbx_SelectedProductID.Text   = tn.Value;
                        tbx_SelectedProductName.Text = tn.Text;
                    }
                }
            }
        }
    }
コード例 #17
0
    private void BindDropDown()
    {
        DropDownList ddl_Brand = (DropDownList)pn_FeeApply.FindControl("FNA_FeeApply_ProductBrand");

        if (ddl_Brand != null)
        {
            ddl_Brand.DataTextField  = "Name";
            ddl_Brand.DataValueField = "ID";
            ddl_Brand.DataSource     = PDT_BrandBLL.GetModelList("IsOpponent='1'");
            ddl_Brand.DataBind();
            ddl_Brand.Items.Add(new ListItem("多品牌", "0"));
        }
    }
コード例 #18
0
        public Inventory(INV_Inventory m)
        {
            Product   = m.Product;
            Quantity  = m.Quantity;
            LotNumber = m.LotNumber;
            CostPrice = m.Price;

            PDT_Product p = new PDT_ProductBLL(Product).Model;

            if (p == null)
            {
                return;
            }

            ProductName = p.ShortName;

            PDT_Brand b = new PDT_BrandBLL(p.Brand).Model;

            if (b != null)
            {
                BrandName = b.Name;
            }

            if (p.Category > 0)
            {
                CategoryName = PDT_CategoryBLL.GetFullCategoryName(p.Category);
            }

            if (p.TrafficPackaging > 0)
            {
                PackingName_T = DictionaryBLL.GetDicCollections("PDT_Packaging")[p.TrafficPackaging.ToString()].ToString();
            }
            if (p.Packaging > 0)
            {
                PackingName_P = DictionaryBLL.GetDicCollections("PDT_Packaging")[p.Packaging.ToString()].ToString();
            }

            if (PackingName_T == "")
            {
                PackingName_T = p.TrafficPackaging.ToString();
            }

            if (p.ConvertFactor == 0)
            {
                p.ConvertFactor = 1;
            }

            ConvertFactor = p.ConvertFactor;
            Quantity_T    = Quantity / p.ConvertFactor;
            Quantity_P    = Quantity % p.ConvertFactor;
        }
コード例 #19
0
    protected string GetPDTBrandName(int product)
    {
        PDT_Product p = new PDT_ProductBLL(product, true).Model;
        PDT_Brand   b = new PDT_BrandBLL(p.Brand).Model;

        if (b != null)
        {
            return(b.Name);
        }
        else
        {
            return("");
        }
    }
コード例 #20
0
    protected void bt_AddProduct_Click(object sender, EventArgs e)
    {
        int product = 0;
        if (int.TryParse(select_Product.SelectValue, out product) && product > 0)
        {
            PDT_Product pdt = new PDT_ProductBLL(product).Model;
            if (pdt == null) return;

            int quantity = int.Parse(tbx_Q1.Text) * pdt.ConvertFactor + int.Parse(tbx_Q2.Text);

            DataTable dt = (DataTable)ViewState["DTDetail"];
            DataRow[] drs = dt.Select("ID=" + product.ToString());
            if (drs.Length > 0)
            {
                drs[0]["Quantity"] = quantity;
            }
            else
            {
                DataRow dr = dt.NewRow();

                decimal factoryprice = 0, price = 0;
                PDT_ProductPriceBLL.GetPriceByClientAndType((int)ViewState["ClientID"], product, (int)ViewState["Type"], out factoryprice, out price);

                dr["ID"] = product;
                dr["Code"] = pdt.Code;
                dr["FullName"] = pdt.FullName;
                dr["ShortName"] = pdt.ShortName;
                dr["Brand"] = pdt.Brand;
                dr["Spec"] = pdt["Spec"];
                dr["Classify"] = pdt.Classify;
                dr["ConvertFactor"] = pdt.ConvertFactor;
                dr["FactoryPrice"] = factoryprice;
                dr["Price"] = price;
                dr["Quantity"] = quantity;

                try
                {
                    dr["BrandName"] = new PDT_BrandBLL(pdt.Brand).Model.Name;
                    dr["ClassifyName"] = new PDT_ClassifyBLL(pdt.Classify).Model.Name;
                    dr["TrafficPackaging"] = DictionaryBLL.GetDicCollections("PDT_Packaging")[pdt.TrafficPackaging.ToString()].Name;
                    dr["Packaging"] = DictionaryBLL.GetDicCollections("PDT_Packaging")[pdt.Packaging.ToString()].Name;
                }
                catch { }

                dt.Rows.Add(dr);
            }
            BindGrid();
        }
    }
コード例 #21
0
    private void BindData()
    {
        PDT_Product m = new PDT_ProductBLL((int)ViewState["ID"]).Model;

        pl_detail.BindData(m);

        if (m.Brand > 0)
        {
            PDT_Brand b = new PDT_BrandBLL(m.Brand).Model;
            ViewState["IsOpponent"] = int.Parse(b.IsOpponent);
        }
        ddl_State_SelectedIndexChanged(null, null);

        bt_OK.Text      = "修改";
        bt_OK.ForeColor = System.Drawing.Color.Red;
    }
コード例 #22
0
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        int forwarddays = ConfigHelper.GetConfigInt("FeeApplyForwardDays");
        ddl_AccountMonth.DataSource = AC_AccountMonthBLL.GetModelList("EndDate>=GETDATE() AND BeginDate<='" + DateTime.Today.AddDays(forwarddays).ToString("yyyy-MM-dd") +
                                                                      "' AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_AccountMonth.DataBind();
        ddl_AccountMonth.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(forwarddays)).ToString();

        ddl_FeeType.DataSource = DictionaryBLL.GetDicCollections("FNA_FeeType").OrderBy(p => p.Value.Name).ToList();
        ddl_FeeType.DataBind();

        foreach (ListItem item in ddl_FeeType.Items)
        {
            if (AC_AccountTitleBLL.GetListByFeeType(int.Parse(item.Value)).Where(p => p.ID > 1).ToList().Count == 0)
            {
                item.Enabled = false;
            }
        }

        if (ConfigHelper.GetConfigBool("FeeApplyByAccountTitleLevel2"))
        {
            tr_AccountTitle2.Visible = true;
            ddl_FeeType.AutoPostBack = true;
            ddl_FeeType.Items.Insert(0, new ListItem("请选择...", "0"));
            ddl_FeeType_SelectedIndexChanged(null, null);
        }

        ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent='1'");
        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("多品牌", "0"));
    }
コード例 #23
0
    private void BindDropDown_ByIsCXP()
    {
        if (ViewState["IsCXP"] == null)
        {
            return;
        }

        if ((bool)ViewState["IsCXP"])
        {
            ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent in('9')");
        }
        else
        {
            ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent in('1')");
        }
        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("所有品牌", "0"));
        ddl_Brand_SelectedIndexChanged(null, null);
    }
コード例 #24
0
    private void BindTree()
    {
        //获取品牌
        string condition = "";

        if (Request.QueryString["IsOpponent"] != null)
        {
            condition = "IsOpponent=" + Request.QueryString["IsOpponent"];
        }

        IList <PDT_Brand> _brands = PDT_BrandBLL.GetModelList(condition);

        foreach (PDT_Brand brand in _brands)
        {
            TreeNode tn_brand = new TreeNode(brand.Name, brand.ID.ToString());
            tr_Product.Nodes.Add(tn_brand);

            IList <PDT_Classify> _classifys = new PDT_ClassifyBLL()._GetModelList("PDT_Classify.Brand=" + brand.ID.ToString());
            foreach (PDT_Classify classify in _classifys)
            {
                TreeNode tn_classify = new TreeNode(classify.Name, classify.ID.ToString());
                tn_brand.ChildNodes.Add(tn_classify);

                IList <PDT_Product> _products = new PDT_ProductBLL()._GetModelList("PDT_Product.State = 1 AND PDT_Product.Classify=" + classify.ID.ToString());
                foreach (PDT_Product product in _products)
                {
                    TreeNode tn = new TreeNode();
                    tn.Text  = product.Code + "  " + product.FullName;
                    tn.Value = product.Code;
                    tn_classify.ChildNodes.Add(tn);

                    if (tn.Value == ViewState["ERPCode"].ToString())
                    {
                        tn_classify.Expand();
                        tn.Select();
                        tbx_SelectedProductCode.Text = tn.Value;
                        tbx_SelectedProductName.Text = tn.Text;
                    }
                }
            }
        }
    }
コード例 #25
0
    private void BindDropDown()
    {
        #region 绑定用户可管辖的片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion
        //if (tr_OrganizeCity.SelectValue != "1")
        //{
        //    select_Client.PageUrl = "../CM/PopSearch/Search_SelectClient.aspx?ClientType=2&OrganizeCity=" + tr_OrganizeCity.SelectValue;
        //}
        //else
        //{
        //    select_Client.PageUrl = "../CM/PopSearch/Search_SelectClient.aspx?ClientType=2";
        //}
        Addr_OrganizeCityBLL city = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue));
        ddl_Level.DataSource = DictionaryBLL.GetDicCollections("Addr_OrganizeCityLevel").Where(p => int.Parse(p.Key) > city.Model.Level && int.Parse(p.Key) <= 4).ToList().OrderBy(p => p.Key);
        ddl_Level.DataBind();
        ddl_Level.Items.Insert(0, new ListItem("本级", "0"));

        ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("(IsOpponent IN (1) OR ID IN (4,5))");
        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("请选择", "0"));

        ddl_BeginMonth.DataSource = AC_AccountMonthBLL.GetModelList("Year>=" + (DateTime.Now.Year - 2).ToString());
        ddl_BeginMonth.DataBind();


        ddl_GiftCostClassify.DataSource = DictionaryBLL.GetDicCollections("ORD_GiftClassify");
        ddl_GiftCostClassify.DataBind();
        ddl_GiftCostClassify.Items.Insert(0, new ListItem("请选择", "0"));
    }
コード例 #26
0
    private void BindDropDown()
    {
        #region 绑定用户可管辖的管理片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        tr_OrganizeCity_Selected(null, null);
        #endregion

        int forwarddays = ConfigHelper.GetConfigInt("FeeApplyForwardDays");
        ddl_ApplyMonth.DataSource = AC_AccountMonthBLL.GetModelList("EndDate>=GETDATE() AND BeginDate<='" + DateTime.Today.AddDays(forwarddays).ToString("yyyy-MM-dd") +
                                                                    "' AND Year>=" + (DateTime.Today.Year - 1).ToString());
        ddl_ApplyMonth.DataBind();
        ddl_ApplyMonth.SelectedValue = AC_AccountMonthBLL.GetMonthByDate(DateTime.Now.AddDays(forwarddays)).ToString();

        rbl_GiftClassify.DataSource = DictionaryBLL.GetDicCollections("ORD_GiftClassify");
        rbl_GiftClassify.DataBind();
        rbl_GiftClassify.SelectedValue = "1";

        ddl_AccountTitle.DataSource = AC_AccountTitleBLL.GetListByFeeType((int)ViewState["GiftFeeType"]);
        ddl_AccountTitle.DataBind();

        ddl_LastWriteOffMonth.DataSource = AC_AccountMonthBLL.GetModelList("BeginDate>=GETDATE() AND BeginDate<DATEADD(month,5,GETDATE())");
        ddl_LastWriteOffMonth.DataBind();

        ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent='1'");
        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("请选择...", "0"));
    }
コード例 #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ddl_Brand = (DropDownList)pl_detail.FindControl("PDT_Product_Brand");

        if (!Page.IsPostBack)
        {
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);

            if ((int)Session["OwnerType"] == 2)
            {
                ddl_Brand.DataSource     = PDT_BrandBLL.GetModelList("IsOpponent=1");
                ddl_Brand.DataValueField = "ID";
                ddl_Brand.DataTextField  = "Name";
                ddl_Brand.DataBind();
            }

            if ((int)ViewState["ID"] > 0)
            {
                BindData();
            }
            else
            {
                if (Request.QueryString["Brand"] != null && Request.QueryString["Brand"] != "0")
                {
                    ddl_Brand.SelectedValue = Request.QueryString["Brand"];
                    ddl_Brand.Enabled       = false;
                }
                MCSTabControl1.Visible = false;
            }
        }

        MCSTreeControl tr_Category = (MCSTreeControl)pl_detail.FindControl("PDT_Product_Category");

        if (tr_Category != null)
        {
            tr_Category.DataSource = PDT_CategoryBLL.GetListByOwnerClient((int)Session["OwnerType"], (int)Session["OwnerClient"]);
            tr_Category.DataBind();
        }
    }
コード例 #28
0
    private void BindDropDown()
    {
        chk_Citylist.DataSource = Addr_OrganizeCityBLL.GetModelList("Level=" + ConfigHelper.GetConfigString("OrganizePartCity-CityLevel"));
        chk_Citylist.DataBind();

        if ((int)ViewState["Type"] == 2)
        {
            MCSTabControl1.SelectedIndex = 2;
            tb_step1.Visible             = MCSTabControl1.SelectedIndex == 0;
        }
        IList <PDT_Brand> _brandList = PDT_BrandBLL.GetModelList("IsOpponent=1");

        ddl_Brand.DataTextField  = "Name";
        ddl_Brand.DataValueField = "ID";
        ddl_Brand.DataSource     = _brandList;
        ddl_Brand.DataBind();
        ddl_Brand.Items.Insert(0, new ListItem("全部", "0"));
        //CheckOrganizeCity();
        ddl_AccountMonth.DataSource = AC_AccountMonthBLL.GetModelList("");
        ddl_AccountMonth.DataBind();
        ddl_AccountMonth.SelectedValue = (AC_AccountMonthBLL.GetCurrentMonth() - 1).ToString();
    }
コード例 #29
0
    protected void bt_OK_Click(object sender, EventArgs e)
    {
        PDT_BrandBLL _Brand = null;
        if (bt_OK.Text == "添加")
        {
            _Brand = new PDT_BrandBLL();
        }
        else
        {
            _Brand = new PDT_BrandBLL((int)ViewState["ID"]);
        }

        pl_detail.GetData(_Brand.Model);
        if (bt_OK.Text == "添加")
        {
            ViewState["ID"] = _Brand.Add();
        }
        else
        {
            _Brand.Update();
        }
        Response.Redirect("PDT_BrandManage.aspx");//?ID=" + ViewState["ID"].ToString());
    }
コード例 #30
0
    protected void bt_OK_Click(object sender, EventArgs e)
    {
        PDT_BrandBLL _Brand = null;

        if (bt_OK.Text == "添加")
        {
            _Brand = new PDT_BrandBLL();
        }
        else
        {
            _Brand = new PDT_BrandBLL((int)ViewState["ID"]);
        }

        pl_detail.GetData(_Brand.Model);
        if (bt_OK.Text == "添加")
        {
            ViewState["ID"] = _Brand.Add();
        }
        else
        {
            _Brand.Update();
        }
        Response.Redirect("PDT_BrandManage.aspx");//?ID=" + ViewState["ID"].ToString());
    }
コード例 #31
0
    private void BindPublish()
    {
        if (tr_OrganizeCity.SelectValue != "0")
        {
            DataTable dt = TreeTableBLL.GetFullPath("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "SuperID", int.Parse(tr_OrganizeCity.SelectValue));

            string citys = "";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                citys += dt.Rows[i]["ID"].ToString();

                if (i < dt.Rows.Count - 1)
                {
                    citys += ",";
                }
            }

            if (rbl_Type.SelectedValue == "1")
            {
                ddl_OrderType.DataSource     = DictionaryBLL.GetDicCollections("ORD_ProductOrderType");
                ddl_OrderType.DataTextField  = "Value";
                ddl_OrderType.DataValueField = "Key";
                ddl_OrderType.DataBind();
                rbl_IsSpecial.DataSource = DictionaryBLL.GetDicCollections("PUB_YesOrNo");
                rbl_IsSpecial.DataBind();
                rbl_IsSpecial.SelectedValue = "2";

                IList <PDT_Brand> _brandList = PDT_BrandBLL.GetModelList("IsOpponent=1");
                ddl_Brand.DataTextField  = "Name";
                ddl_Brand.DataValueField = "ID";
                ddl_Brand.DataSource     = _brandList;
                ddl_Brand.DataBind();
                ddl_Brand_SelectedIndexChanged(null, null);
            }
        }
    }
コード例 #32
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DropDownList ddl_Brand = (DropDownList)pl_detail.FindControl("PDT_Product_Brand");

        if (ddl_Brand != null)
        {
            ddl_Brand.SelectedIndexChanged += new EventHandler(ddl_Brand_SelectedIndexChanged);
            ddl_Brand.AutoPostBack          = true;
        }

        DropDownList ddl_Classify = (DropDownList)pl_detail.FindControl("PDT_Product_Classify");

        if (ddl_Classify != null)
        {
            ddl_Classify.SelectedIndexChanged += new EventHandler(ddl_Classify_SelectedIndexChanged);
            ddl_Classify.AutoPostBack          = true;
        }

        DropDownList ddl_State = (DropDownList)pl_detail.FindControl("PDT_Product_State");

        if (ddl_State != null)
        {
            ddl_State.SelectedIndexChanged += new EventHandler(ddl_State_SelectedIndexChanged);
            ddl_State.AutoPostBack          = true;
        }

        if (!Page.IsPostBack)
        {
            ViewState["ID"]         = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);
            ViewState["IsOpponent"] = Request.QueryString["IsOpponent"] == null ? 0 : int.Parse(Request.QueryString["IsOpponent"]);

            #region 如果没有IsOpponent参数传入,则自行获取
            if ((int)ViewState["IsOpponent"] == 0)
            {
                PDT_Product p = new PDT_ProductBLL((int)ViewState["ID"]).Model;
                PDT_Brand   b = new PDT_BrandBLL(p.Brand).Model;
                ViewState["IsOpponent"] = int.Parse(b.IsOpponent);
            }
            #endregion

            ddl_Brand.DataSource     = PDT_BrandBLL.GetModelList("IsOpponent=" + ViewState["IsOpponent"].ToString());
            ddl_Brand.DataValueField = "ID";
            ddl_Brand.DataTextField  = "Name";
            ddl_Brand.DataBind();

            if ((int)ViewState["ID"] > 0)
            {
                BindData();
            }
            else
            {
                if (Request.QueryString["Brand"] != null && Request.QueryString["Brand"] != "0")
                {
                    ddl_Brand.SelectedValue = Request.QueryString["Brand"];
                    ddl_Brand.Enabled       = false;
                    ddl_Brand_SelectedIndexChanged(ddl_Brand, null);
                }
                MCSTabControl1.Visible = false;
            }

            Header.Attributes["WebPageSubCode"] = "IsOpponent=" + ViewState["IsOpponent"].ToString();
            ddl_Brand_SelectedIndexChanged(null, null);
        }
    }
コード例 #33
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DropDownList ddl_Brand = (DropDownList)pl_detail.FindControl("PDT_Product_Brand");
        if (ddl_Brand != null)
        {
            ddl_Brand.SelectedIndexChanged += new EventHandler(ddl_Brand_SelectedIndexChanged);
            ddl_Brand.AutoPostBack = true;
        }

        DropDownList ddl_Classify = (DropDownList)pl_detail.FindControl("PDT_Product_Classify");
        if (ddl_Classify != null)
        {
            ddl_Classify.SelectedIndexChanged += new EventHandler(ddl_Classify_SelectedIndexChanged);
            ddl_Classify.AutoPostBack = true;
        }

        DropDownList ddl_State = (DropDownList)pl_detail.FindControl("PDT_Product_State");
        if (ddl_State != null)
        {
            ddl_State.SelectedIndexChanged += new EventHandler(ddl_State_SelectedIndexChanged);
            ddl_State.AutoPostBack = true;
        }

        if (!Page.IsPostBack)
        {
            ViewState["ID"] = Request.QueryString["ID"] == null ? 0 : int.Parse(Request.QueryString["ID"]);
            ViewState["IsOpponent"] = Request.QueryString["IsOpponent"] == null ? 0 : int.Parse(Request.QueryString["IsOpponent"]);

            #region 如果没有IsOpponent参数传入,则自行获取
            if ((int)ViewState["IsOpponent"] == 0)
            {
                PDT_Product p = new PDT_ProductBLL((int)ViewState["ID"]).Model;
                PDT_Brand b = new PDT_BrandBLL(p.Brand).Model;
                ViewState["IsOpponent"] = int.Parse(b.IsOpponent);
            }
            #endregion

            ddl_Brand.DataSource = PDT_BrandBLL.GetModelList("IsOpponent=" + ViewState["IsOpponent"].ToString());
            ddl_Brand.DataValueField = "ID";
            ddl_Brand.DataTextField = "Name";
            ddl_Brand.DataBind();

            if ((int)ViewState["ID"] > 0)
            {
                BindData();
            }
            else
            {
                if (Request.QueryString["Brand"] != null && Request.QueryString["Brand"] != "0")
                {
                    ddl_Brand.SelectedValue = Request.QueryString["Brand"];
                    ddl_Brand.Enabled = false;
                    ddl_Brand_SelectedIndexChanged(ddl_Brand, null);
                }
                MCSTabControl1.Visible = false;
            }

            Header.Attributes["WebPageSubCode"] = "IsOpponent=" + ViewState["IsOpponent"].ToString();
            ddl_Brand_SelectedIndexChanged(null, null);
        }
    }
コード例 #34
0
    private void BindData()
    {
        PDT_Product m = new PDT_ProductBLL((int)ViewState["ID"]).Model;
        pl_detail.BindData(m);

        if (m.Brand > 0)
        {
            PDT_Brand b = new PDT_BrandBLL(m.Brand).Model;
            ViewState["IsOpponent"] = int.Parse(b.IsOpponent);
        }
        ddl_State_SelectedIndexChanged(null, null);

        bt_OK.Text = "修改";
        bt_OK.ForeColor = System.Drawing.Color.Red;
    }
コード例 #35
0
    protected void gv_Detail_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            ListTable<CM_ContractDetail> _details = ViewState["Details"] as ListTable<CM_ContractDetail>;
            int accounttitle = int.Parse(gv_Detail.DataKeys[e.Row.RowIndex]["AccountTitle"].ToString());
            int _id = int.Parse(gv_Detail.DataKeys[e.Row.RowIndex]["ID"].ToString());
            Label lb_RelateBrand = (Label)e.Row.FindControl("lb_RelateBrand");
            if (lb_RelateBrand != null)
            {
                foreach (string brand in _details[_id.ToString()]["RelateBrand"].Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    PDT_Brand b = new PDT_BrandBLL(int.Parse(brand)).Model;
                    if (b != null) lb_RelateBrand.Text += b.Name + ",";
                }
            }
            int ContractFeeType = ConfigHelper.GetConfigInt("ContractFeeType");
            int ContractAccountTitle = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["ContractAccountTitle"]);

            #region 判断是否NKA店,如是NKA店,则获取NKA的会计科目
            int client = 0;
            if (ViewState["ContractID"] == null && ViewState["ClientID"] == null) return;
            if (ViewState["ClientID"] != null)
            {
                client = (int)ViewState["ClientID"];
            }
            else
            {
                CM_Contract c = new CM_ContractBLL((int)ViewState["ContractID"]).Model;
                if (c != null) client = c.Client;
            }

            if (client > 0)
            {
                CM_Client c = new CM_ClientBLL(client).Model;
                if (c != null && c["RTChannel"] == "1" && ConfigHelper.GetConfigInt("ContractFeeType-KA") > 0)
                {
                    ContractFeeType = ConfigHelper.GetConfigInt("ContractFeeType-KA");
                    ContractAccountTitle = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["ContractAccountTitle-KA"]);
                }
            }
            #endregion

        }
    }
コード例 #36
0
        private void FillModel(PDT_Product m, int TDP)
        {
            ID            = m.ID;
            FullName      = m.FullName;
            ShortName     = m.ShortName;
            Code          = m.Code;
            BarCode       = m.BarCode;
            BoxBarCode    = m.BoxBarCode;
            ConvertFactor = m.ConvertFactor;
            Spec          = m.Spec;
            Remark        = m.Remark;
            Grade         = m.Grade;
            Category      = m.Category;
            FactoryCode   = m.FactoryCode;
            FactoryName   = m.FactoryName;

            #region 获取商品的TDP扩展管理信息
            if (TDP != 0)
            {
                IList <PDT_ProductExtInfo> exts = PDT_ProductExtInfoBLL.GetModelList("Supplier=" + TDP.ToString() + " AND Product=" + m.ID.ToString());
                if (exts.Count > 0)
                {
                    TDPCode = exts[0].Code;
                    if (exts[0].Category != 0)
                    {
                        Category = exts[0].Category;
                    }
                    BuyPrice   = exts[0].BuyPrice;
                    SalesPrice = exts[0].SalesPrice;
                }
            }
            #endregion

            #region 获取品牌、系列、类别名称
            if (m.Brand > 0)
            {
                PDT_Brand brand = new PDT_BrandBLL(m.Brand).Model;
                if (brand != null)
                {
                    BrandName = brand.Name;
                }
            }
            if (m.Classify > 0)
            {
                PDT_Classify classify = new PDT_ClassifyBLL(m.Classify).Model;
                if (classify != null)
                {
                    ClassifyName = classify.Name;
                }
            }
            if (Category > 0)
            {
                CategoryName = PDT_CategoryBLL.GetFullCategoryName(Category);
            }
            #endregion

            #region 获取字典表名称
            try
            {
                if (m.Grade > 0)
                {
                    Dictionary_Data dic = DictionaryBLL.GetDicCollections("PDT_Grade")[m.Grade.ToString()];
                    if (dic != null)
                    {
                        GradeName = dic.Name;
                    }
                }

                if (m.TrafficPackaging > 0)
                {
                    Dictionary_Data dic = DictionaryBLL.GetDicCollections("PDT_Packaging")[m.TrafficPackaging.ToString()];
                    if (dic != null)
                    {
                        TrafficPackagingName = dic.Name;
                    }
                }
                if (m.Packaging > 0)
                {
                    Dictionary_Data dic = DictionaryBLL.GetDicCollections("PDT_Packaging")[m.Packaging.ToString()];
                    if (dic != null)
                    {
                        PackagingName = dic.Name;
                    }
                }
            }
            catch (System.Exception err)
            {
                LogWriter.WriteLog("MCSFramework.WSI.Product", err);
            }
            #endregion

            #region 获取首要图片
            string condition = " RelateType=11 AND RelateID=" + m.ID.ToString() + " AND MCS_SYS.dbo.UF_Spilt(ExtPropertys,'|',1)='Y'";
            IList <ATMT_Attachment> lists = ATMT_AttachmentBLL.GetModelList(condition);
            if (lists.Count > 0 && ATMT_AttachmentBLL.IsImage(lists[0].ExtName))
            {
                ImageGUID = lists[0].GUID;
            }
            #endregion

            #region 获取附件明细
            Atts = new List <Attachment>();
            IList <ATMT_Attachment> atts = ATMT_AttachmentBLL.GetAttachmentList(11, m.ID, new DateTime(1900, 1, 1), new DateTime(2100, 1, 1));
            foreach (ATMT_Attachment item in atts.OrderBy(p => p.Name))
            {
                Atts.Add(new Attachment(item));
            }
            #endregion
        }
コード例 #37
0
    protected void gv_List_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            int id = (int)gv_List.DataKeys[e.Row.RowIndex]["ID"];
            if (id > 0)
            {
                Button bt_OpenAdjust = (Button)e.Row.FindControl("bt_OpenAdjust");
                bt_OpenAdjust.OnClientClick = "PopAdjust(" + id.ToString() + ")";
            }

            ListTable<FNA_FeeApplyDetail> _details = ViewState["Details"] as ListTable<FNA_FeeApplyDetail>;
            FNA_FeeApplyDetail item = _details[id.ToString()];

            if (item.Client > 0)
            {
                HyperLink hy_Client = (HyperLink)e.Row.FindControl("hy_Client");
                if (hy_Client != null)
                {
                    CM_Client c = new CM_ClientBLL(item.Client).Model;
                    if (c != null)
                    {
                        hy_Client.Text = c.FullName;
                        hy_Client.NavigateUrl = "../FeeApplyOrWriteoffByClientList.aspx?ClientID=" + item.Client.ToString();

                        int linkman = 0;
                        if (int.TryParse(item["RelateLinkMan"], out linkman) && linkman > 0)
                        {
                            HyperLink hy_RelateLinkMan = (HyperLink)e.Row.FindControl("hy_RelateLinkMan");
                            if (hy_RelateLinkMan != null)
                            {
                                CM_LinkMan m = new CM_LinkManBLL(linkman).Model;
                                if (m != null)
                                {
                                    hy_RelateLinkMan.Text = m.Name;
                                    if (c.ClientType == 5)
                                        hy_RelateLinkMan.NavigateUrl = "~/SubModule/CM/Hospital/DoctorDetail.aspx?ID=" + m.ID.ToString();
                                    else
                                        hy_RelateLinkMan.NavigateUrl = "~/SubModule/CM/LM/LinkManDetail.aspx.aspx?ID=" + m.ID.ToString();
                                }
                            }
                        }
                    }
                }
            }

            Label lb_RelateBrand = (Label)e.Row.FindControl("lb_RelateBrand");
            if (lb_RelateBrand != null)
            {
                foreach (string brand in item.RelateBrands.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    PDT_Brand b = new PDT_BrandBLL(int.Parse(brand)).Model;
                    if (b != null) lb_RelateBrand.Text += b.Name + ",";
                }
            }

        }
    }
コード例 #38
0
        private void FillModel(PDT_Product m, int TDP)
        {
            ID = m.ID;
            FullName = m.FullName;
            ShortName = m.ShortName;
            Code = m.Code;
            BarCode = m.BarCode;
            BoxBarCode = m.BoxBarCode;
            ConvertFactor = m.ConvertFactor;
            Spec = m.Spec;
            Remark = m.Remark;
            Grade = m.Grade;
            Category = m.Category;
            FactoryCode = m.FactoryCode;
            FactoryName = m.FactoryName;

            #region 获取商品的TDP扩展管理信息
            if (TDP != 0)
            {
                IList<PDT_ProductExtInfo> exts = PDT_ProductExtInfoBLL.GetModelList("Supplier=" + TDP.ToString() + " AND Product=" + m.ID.ToString());
                if (exts.Count > 0)
                {
                    TDPCode = exts[0].Code;
                    if (exts[0].Category != 0) Category = exts[0].Category;
                    BuyPrice = exts[0].BuyPrice;
                    SalesPrice = exts[0].SalesPrice;
                }
            }
            #endregion

            #region 获取品牌、系列、类别名称
            if (m.Brand > 0)
            {
                PDT_Brand brand = new PDT_BrandBLL(m.Brand).Model;
                if (brand != null) BrandName = brand.Name;
            }
            if (m.Classify > 0)
            {
                PDT_Classify classify = new PDT_ClassifyBLL(m.Classify).Model;
                if (classify != null) ClassifyName = classify.Name;
            }
            if (Category > 0)
            {
                CategoryName = PDT_CategoryBLL.GetFullCategoryName(Category);
            }
            #endregion

            #region 获取字典表名称
            try
            {
                if (m.Grade > 0)
                {
                    Dictionary_Data dic = DictionaryBLL.GetDicCollections("PDT_Grade")[m.Grade.ToString()];
                    if (dic != null) GradeName = dic.Name;
                }

                if (m.TrafficPackaging > 0)
                {
                    Dictionary_Data dic = DictionaryBLL.GetDicCollections("PDT_Packaging")[m.TrafficPackaging.ToString()];
                    if (dic != null) TrafficPackagingName = dic.Name;
                }
                if (m.Packaging > 0)
                {
                    Dictionary_Data dic = DictionaryBLL.GetDicCollections("PDT_Packaging")[m.Packaging.ToString()];
                    if (dic != null) PackagingName = dic.Name;
                }
            }
            catch (System.Exception err)
            {
                LogWriter.WriteLog("MCSFramework.WSI.Product", err);
            }
            #endregion

            #region 获取首要图片
            string condition = " RelateType=11 AND RelateID=" + m.ID.ToString() + " AND MCS_SYS.dbo.UF_Spilt(ExtPropertys,'|',1)='Y'";
            IList<ATMT_Attachment> lists = ATMT_AttachmentBLL.GetModelList(condition);
            if (lists.Count > 0 && ATMT_AttachmentBLL.IsImage(lists[0].ExtName))
            {
                ImageGUID = lists[0].GUID;
            }
            #endregion

            #region 获取附件明细
            Atts = new List<Attachment>();
            IList<ATMT_Attachment> atts = ATMT_AttachmentBLL.GetAttachmentList(11, m.ID, new DateTime(1900, 1, 1), new DateTime(2100, 1, 1));
            foreach (ATMT_Attachment item in atts.OrderBy(p => p.Name))
            {
                Atts.Add(new Attachment(item));
            }
            #endregion
        }
コード例 #39
0
        public Inventory(INV_Inventory m)
        {
            Product = m.Product;
            Quantity = m.Quantity;
            LotNumber = m.LotNumber;
            CostPrice = m.Price;

            PDT_Product p = new PDT_ProductBLL(Product).Model;
            if (p == null) return;

            ProductName = p.ShortName;

            PDT_Brand b = new PDT_BrandBLL(p.Brand).Model;
            if (b != null) BrandName = b.Name;

            if (p.Category > 0)
            {
                CategoryName = PDT_CategoryBLL.GetFullCategoryName(p.Category);
            }

            if (p.TrafficPackaging > 0) PackingName_T = DictionaryBLL.GetDicCollections("PDT_Packaging")[p.TrafficPackaging.ToString()].ToString();
            if (p.Packaging > 0) PackingName_P = DictionaryBLL.GetDicCollections("PDT_Packaging")[p.Packaging.ToString()].ToString();

            if (PackingName_T == "") PackingName_T = p.TrafficPackaging.ToString();

            if (p.ConvertFactor == 0) p.ConvertFactor = 1;

            ConvertFactor = p.ConvertFactor;
            Quantity_T = Quantity / p.ConvertFactor;
            Quantity_P = Quantity % p.ConvertFactor;
        }
コード例 #40
0
    protected void gv_List_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            int id = (int)gv_List.DataKeys[e.Row.RowIndex]["ID"];
            if (id > 0)
            {
                Button bt_OpenAdjust = (Button)e.Row.FindControl("bt_OpenAdjust");
                bt_OpenAdjust.OnClientClick = "PopAdjust(" + id.ToString() + ")";
            }

            ListTable <FNA_FeeApplyDetail> _details = ViewState["Details"] as ListTable <FNA_FeeApplyDetail>;
            FNA_FeeApplyDetail             item     = _details[id.ToString()];

            if (item.Client > 0)
            {
                HyperLink hy_Client = (HyperLink)e.Row.FindControl("hy_Client");
                if (hy_Client != null)
                {
                    CM_Client c = new CM_ClientBLL(item.Client).Model;
                    if (c != null)
                    {
                        hy_Client.Text        = c.FullName;
                        hy_Client.NavigateUrl = "../FeeApplyOrWriteoffByClientList.aspx?ClientID=" + item.Client.ToString();

                        int linkman = 0;
                        if (int.TryParse(item["RelateLinkMan"], out linkman) && linkman > 0)
                        {
                            HyperLink hy_RelateLinkMan = (HyperLink)e.Row.FindControl("hy_RelateLinkMan");
                            if (hy_RelateLinkMan != null)
                            {
                                CM_LinkMan m = new CM_LinkManBLL(linkman).Model;
                                if (m != null)
                                {
                                    hy_RelateLinkMan.Text = m.Name;
                                    if (c.ClientType == 5)
                                    {
                                        hy_RelateLinkMan.NavigateUrl = "~/SubModule/CM/Hospital/DoctorDetail.aspx?ID=" + m.ID.ToString();
                                    }
                                    else
                                    {
                                        hy_RelateLinkMan.NavigateUrl = "~/SubModule/CM/LM/LinkManDetail.aspx.aspx?ID=" + m.ID.ToString();
                                    }
                                }
                            }
                        }
                    }
                }
            }

            Label lb_RelateBrand = (Label)e.Row.FindControl("lb_RelateBrand");
            if (lb_RelateBrand != null)
            {
                foreach (string brand in item.RelateBrands.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    PDT_Brand b = new PDT_BrandBLL(int.Parse(brand)).Model;
                    if (b != null)
                    {
                        lb_RelateBrand.Text += b.Name + ",";
                    }
                }
            }
        }
    }