Example #1
0
        /// <summary>
        /// 加载dropdownlist数据
        /// </summary>
        void LoadNewPanelDropDownList()
        {
            using (GoldEntities context = new GoldEntities())
            {
                //绑定型号
                var allModelList = (from r in context.Models orderby r.ModelName select new { r.ModelId, r.ModelName }).ToList();
                DropDownList_CargoModel.Items.Clear();
                DropDownList_CargoModel.DataTextField  = "ModelName";
                DropDownList_CargoModel.DataValueField = "ModelID";
                DropDownList_CargoModel.DataSource     = allModelList;
                DropDownList_CargoModel.DataBind();
                DropDownList_CargoModel.Items.Insert(0, new ListItem("", ""));

                //绑定规格
                var allSpecList = (from r in context.Specifications orderby r.SpecName select new { r.SpecId, r.SpecName }).ToList();
                DropDownList_CargoSpec.Items.Clear();
                DropDownList_CargoSpec.DataTextField  = "SpecName";
                DropDownList_CargoSpec.DataValueField = "SpecId";
                DropDownList_CargoSpec.DataSource     = allSpecList;
                DropDownList_CargoSpec.DataBind();
                DropDownList_CargoSpec.Items.Insert(0, new ListItem("", ""));

                //绑定仓库
                var result = (from r in context.WareHouse select new { r.WHCode, r.WHName }).OrderBy(r => r.WHCode).ToList();
                DropDownList_WHCode.Items.Clear();
                DropDownList_WHCode.DataTextField  = "WHName";
                DropDownList_WHCode.DataValueField = "WHCode";
                DropDownList_WHCode.DataSource     = result;
                DropDownList_WHCode.DataBind();
                DropDownList_WHCode.Items.Insert(0, new ListItem("", ""));
            }
        }
Example #2
0
        /// <summary>
        /// 加载dropdownlist数据
        /// </summary>
        void LoadNewPanelDropDownList()
        {
            using (GoldEntities context = new GoldEntities())
            {
                //绑定盘点计划单状态
                List <NameValueModel> ListStatus = Gold.Utility.EnumData.GetEnumsList(typeof(Gold.Utility.EnumData.SCPStatusEnum));
                DropDownList_SCPStatus.Items.Clear();
                DropDownList_SCPStatus.DataTextField  = "Name";
                DropDownList_SCPStatus.DataValueField = "Value";
                DropDownList_SCPStatus.DataSource     = ListStatus;
                DropDownList_SCPStatus.DataBind();
                DropDownList_SCPStatus.Items.Insert(0, new ListItem("", ""));

                //绑定盘点计划单状态
                List <NameValueModel> ListType = Gold.Utility.EnumData.GetEnumsList(typeof(Gold.Utility.EnumData.SCPTypeEnum));
                DropDownList_Type.Items.Clear();
                DropDownList_Type.DataTextField  = "Name";
                DropDownList_Type.DataValueField = "Value";
                DropDownList_Type.DataSource     = ListType;
                DropDownList_Type.DataBind();
                DropDownList_Type.Items.Insert(0, new ListItem("", ""));

                //绑定仓库
                var result = (from r in context.WareHouse select new { r.WHCode, r.WHName }).OrderBy(r => r.WHCode).ToList();
                DropDownList_WHCode.Items.Clear();
                DropDownList_WHCode.DataTextField  = "WHName";
                DropDownList_WHCode.DataValueField = "WHCode";
                DropDownList_WHCode.DataSource     = result;
                DropDownList_WHCode.DataBind();
                DropDownList_WHCode.Items.Insert(0, new ListItem("", ""));
            }
        }
Example #3
0
        /// <summary>
        /// 加载dropdownlist数据
        /// </summary>
        void LoadNewPanelDropDownList()
        {
            using (GoldEntities context = new GoldEntities())
            {
                //绑定存提状态
                List <NameValueModel> ListPickOrStore = Gold.Utility.EnumData.GetEnumsList(typeof(Gold.Utility.EnumData.PickOrStore));
                DropDownList_StorePickType.Items.Clear();
                DropDownList_StorePickType.DataTextField  = "Name";
                DropDownList_StorePickType.DataValueField = "Value";
                DropDownList_StorePickType.DataSource     = ListPickOrStore;
                DropDownList_StorePickType.DataBind();
                DropDownList_StorePickType.Items.Insert(0, new ListItem("", ""));

                //绑定盈亏状态
                List <NameValueModel> ListIsProfitOrLoss = Gold.Utility.EnumData.GetEnumsList(typeof(Gold.Utility.EnumData.IsProfitOrLoss));
                DropDownList_IsProfitOrLoss.Items.Clear();
                DropDownList_IsProfitOrLoss.DataTextField  = "Name";
                DropDownList_IsProfitOrLoss.DataValueField = "Value";
                DropDownList_IsProfitOrLoss.DataSource     = ListIsProfitOrLoss;
                DropDownList_IsProfitOrLoss.DataBind();
                DropDownList_IsProfitOrLoss.Items.Insert(0, new ListItem("", ""));

                //绑定包装
                var result = (from r in context.Packages select new { r.PackageId, r.PackageName }).OrderBy(r => r.PackageName).ToList();
                DropDownList_PackageName.Items.Clear();
                DropDownList_PackageName.DataTextField  = "PackageName";
                DropDownList_PackageName.DataValueField = "PackageId";
                DropDownList_PackageName.DataSource     = result;
                DropDownList_PackageName.DataBind();
                DropDownList_PackageName.Items.Insert(0, new ListItem("", ""));

                //绑定仓库
                var resultWH = (from r in context.WareHouse select new { r.WHCode, r.WHName }).OrderBy(r => r.WHCode).ToList();
                DropDownList_WHCode.Items.Clear();
                DropDownList_WHCode.DataTextField  = "WHName";
                DropDownList_WHCode.DataValueField = "WHCode";
                DropDownList_WHCode.DataSource     = resultWH;
                DropDownList_WHCode.DataBind();
                DropDownList_WHCode.Items.Insert(0, new ListItem("", ""));
            }
        }
Example #4
0
        /// <summary>
        /// 加载新增Panel中的dropdownlist数据
        /// </summary>
        void LoadNewPanelDropDownList()
        {
            using (GoldEntities context = new GoldEntities())
            {
                //绑定型号
                var allModelList = (from r in context.Models orderby r.ModelName select new { r.ModelId, r.ModelName }).ToList();
                DropDownList_CargoModel.Items.Clear();
                DropDownList_CargoModel.DataTextField  = "ModelName";
                DropDownList_CargoModel.DataValueField = "ModelID";
                DropDownList_CargoModel.DataSource     = allModelList;
                DropDownList_CargoModel.DataBind();
                DropDownList_CargoModel.Items.Insert(0, new ListItem("", ""));

                //绑定规格
                var allSpecList = (from r in context.Specifications orderby r.SpecName select new { r.SpecId, r.SpecName }).ToList();
                DropDownList_CargoSpec.Items.Clear();
                DropDownList_CargoSpec.DataTextField  = "SpecName";
                DropDownList_CargoSpec.DataValueField = "SpecId";
                DropDownList_CargoSpec.DataSource     = allSpecList;
                DropDownList_CargoSpec.DataBind();
                DropDownList_CargoSpec.Items.Insert(0, new ListItem("", ""));

                //绑定仓库
                var result = (from r in context.WareHouse select new { r.WHCode, r.WHName }).OrderBy(r => r.WHCode).ToList();
                DropDownList_WHCode.Items.Clear();
                DropDownList_WHCode.DataTextField  = "WHName";
                DropDownList_WHCode.DataValueField = "WHCode";
                DropDownList_WHCode.DataSource     = result;
                DropDownList_WHCode.DataBind();
                DropDownList_WHCode.Items.Insert(0, new ListItem("", ""));

                //绑定是否低于安全库存量状态
                List <NameValueModel> ListIsUnderSafeLine = Gold.Utility.EnumData.GetEnumsList(typeof(Gold.Utility.EnumData.IsUnderSafeLine));
                DropDownList_IsUnderSafe.Items.Clear();
                DropDownList_IsUnderSafe.DataTextField  = "Name";
                DropDownList_IsUnderSafe.DataValueField = "Value";
                DropDownList_IsUnderSafe.DataSource     = ListIsUnderSafeLine;
                DropDownList_IsUnderSafe.DataBind();
                DropDownList_IsUnderSafe.Items.Insert(0, new ListItem("", ""));
            }
        }
Example #5
0
        /// <summary>
        /// 加载新增Panel中的dropdownlist数据
        /// </summary>
        void LoadNewPanelDropDownList()
        {
            using (GoldEntities context = new GoldEntities())
            {
                //绑定包装  查询
                var result = (from r in context.Packages select new { r.PackageId, r.PackageName }).OrderBy(r => r.PackageName).ToList();
                DropDownList_PackageName.Items.Clear();
                DropDownList_PackageName.DataTextField  = "PackageName";
                DropDownList_PackageName.DataValueField = "PackageId";
                DropDownList_PackageName.DataSource     = result;
                DropDownList_PackageName.DataBind();
                DropDownList_PackageName.Items.Insert(0, new ListItem("", ""));

                //绑定包装  新增
                DropDownListNewPackage.Items.Clear();
                DropDownListNewPackage.DataTextField  = "PackageName";
                DropDownListNewPackage.DataValueField = "PackageId";
                DropDownListNewPackage.DataSource     = result;
                DropDownListNewPackage.DataBind();
                DropDownListNewPackage.Items.Insert(0, new ListItem("", ""));

                //绑定仓库 查询
                var resultWH = (from r in context.WareHouse select new { r.WHCode, r.WHName }).OrderBy(r => r.WHCode).ToList();
                DropDownList_WHCode.Items.Clear();
                DropDownList_WHCode.DataTextField  = "WHName";
                DropDownList_WHCode.DataValueField = "WHCode";
                DropDownList_WHCode.DataSource     = resultWH;
                DropDownList_WHCode.DataBind();
                DropDownList_WHCode.Items.Insert(0, new ListItem("", ""));

                //绑定仓库 新增
                DropDownListNewWHCode.Items.Clear();
                DropDownListNewWHCode.DataTextField  = "WHName";
                DropDownListNewWHCode.DataValueField = "WHCode";
                DropDownListNewWHCode.DataSource     = resultWH;
                DropDownListNewWHCode.DataBind();
                DropDownListNewWHCode.Items.Insert(0, new ListItem("", ""));
            }
        }
Example #6
0
        /// <summary>
        /// 加载新增Panel中的dropdownlist数据
        /// </summary>
        void LoadNewPanelDropDownList()
        {
            using (GoldEntities context = new GoldEntities())
            {
                //绑定型号
                var allModelList = (from r in context.Models orderby r.ModelName select new { r.ModelId, r.ModelName }).ToList();
                DropDownList_CargoModel.Items.Clear();
                DropDownList_CargoModel.DataTextField  = "ModelName";
                DropDownList_CargoModel.DataValueField = "ModelID";
                DropDownList_CargoModel.DataSource     = allModelList;
                DropDownList_CargoModel.DataBind();
                DropDownList_CargoModel.Items.Insert(0, new ListItem("", ""));

                //绑定规格
                var allSpecList = (from r in context.Specifications orderby r.SpecName select new { r.SpecId, r.SpecName }).ToList();
                DropDownList_CargoSpec.Items.Clear();
                DropDownList_CargoSpec.DataTextField  = "SpecName";
                DropDownList_CargoSpec.DataValueField = "SpecId";
                DropDownList_CargoSpec.DataSource     = allSpecList;
                DropDownList_CargoSpec.DataBind();
                DropDownList_CargoSpec.Items.Insert(0, new ListItem("", ""));

                //绑定仓库
                var result = (from r in context.WareHouse select new { r.WHCode, r.WHName }).OrderBy(r => r.WHCode).ToList();
                DropDownList_WHCode.Items.Clear();
                DropDownList_WHCode.DataTextField  = "WHName";
                DropDownList_WHCode.DataValueField = "WHCode";
                DropDownList_WHCode.DataSource     = result;
                DropDownList_WHCode.DataBind();
                DropDownList_WHCode.Items.Insert(0, new ListItem("", ""));

                string whCode = WebConfigHelper.Instance.GetAppSettingValue("DefaultWHCode");
                var    WHName = (from r in context.WareHouse where r.WHCode == whCode select r.WHName).FirstOrDefault();
                if (WHName != null)
                {
                    lblWHName.Text = WHName.ToString();
                }
            }
        }
Example #7
0
        private void LoadInfo(string ItemID)
        {
            using (GoldEntities context = new GoldEntities())
            {
                //绑定盘点计划单状态
                List <NameValueModel> ListBinType = Gold.Utility.EnumData.GetEnumsList(typeof(Gold.Utility.EnumData.SCPTypeEnum));
                DropDownList_SCPType.Items.Clear();
                DropDownList_SCPType.DataTextField  = "Name";
                DropDownList_SCPType.DataValueField = "Value";
                DropDownList_SCPType.DataSource     = ListBinType;
                DropDownList_SCPType.DataBind();
                DropDownList_SCPType.Items.Insert(0, new ListItem("", ""));

                //绑定仓库
                var result = (from r in context.WareHouse select new { r.WHCode, r.WHName }).OrderBy(r => r.WHCode).ToList();
                DropDownList_WHCode.Items.Clear();
                DropDownList_WHCode.DataTextField  = "WHName";
                DropDownList_WHCode.DataValueField = "WHCode";
                DropDownList_WHCode.DataSource     = result;
                DropDownList_WHCode.DataBind();
                DropDownList_WHCode.Items.Insert(0, new ListItem("", ""));

                string defaultWHCode = WebConfigHelper.Instance.GetAppSettingValue("DefaultWHCode");
                DropDownList_WHCode.SelectedIndex = DropDownList_WHCode.Items.IndexOf(DropDownList_WHCode.Items.FindByValue(defaultWHCode));
                DropDownList_WHCode.Enabled       = false;//目前只支持对地王26库的盘点,故仓库选项禁用

                //货架名称 例如A架
                var BinCodeFirstLetterList = (from r in context.StorageBin orderby r.BinCode.Substring(0, 1) select new { BinShort = r.BinCode.Substring(0, 1) }).Distinct();

                //层位名
                var BinCodeTotalCodeList = (from r in context.StorageBin orderby r.BinCode select r.BinCode);

                //层中小区域名及每个小区域数量
                var CargoTagBinCodeAndNumberList = (from r in context.CargoTag orderby r.BinCode group r by r.BinCode into x select new { BinCode = x.Key, Number = x.Sum(r => r.Number) });

                //编辑状态下进入此页面时
                if (ItemID != "-1")
                {
                    StockCountingPlan existModel = (from r in context.StockCountingPlan where r.SCPCode == ItemID select r).FirstOrDefault();

                    if (existModel != null)
                    {
                        List <StockCountingDetail> detailList = (from r in context.StockCountingDetail where r.SCPCode == existModel.SCPCode select r).ToList <StockCountingDetail>();
                        tbxSCPCode.Text = existModel.SCPCode;
                        //设置选中项
                        DropDownList_SCPType.SelectedIndex = DropDownList_SCPType.Items.IndexOf(DropDownList_SCPType.Items.FindByValue(existModel.SCPType.Value.ToString()));

                        tbxComment.Text = existModel.Comment;

                        //将数据导入到TreeView中
                        foreach (var binCodeFirstLetter in BinCodeFirstLetterList)
                        {
                            TreeNode FirstLevelNode = new TreeNode(binCodeFirstLetter.BinShort, binCodeFirstLetter.BinShort);
                            FirstLevelNode.Collapse();
                            TreeView_Scope.Nodes.Add(FirstLevelNode);

                            var TempBinCodeTotalCodeList = (from r in BinCodeTotalCodeList where r.StartsWith(binCodeFirstLetter.BinShort) select r);
                            foreach (var binCodeTotalCode in TempBinCodeTotalCodeList)
                            {
                                TreeNode SecondLevelNode = new TreeNode(binCodeTotalCode, binCodeTotalCode);
                                FirstLevelNode.ChildNodes.Add(SecondLevelNode);

                                var TempCargoTagBinCodeAndNumberList = (from r in CargoTagBinCodeAndNumberList where r.BinCode.StartsWith(binCodeTotalCode) select r);
                                foreach (var temp in TempCargoTagBinCodeAndNumberList)
                                {
                                    string ShowName = temp.BinCode + "&nbsp;&nbsp;[现存" + (temp.Number == null ? "0" : temp.Number.Value.ToString()).PadLeft(5, ' ') + "枚]";

                                    TreeNode ThirdLevelNode = new TreeNode(ShowName, temp.BinCode);
                                    SecondLevelNode.ChildNodes.Add(ThirdLevelNode);

                                    //判断是否在计划单中,若在计划单中则选中
                                    var existInThePlan = (from r in detailList where r.BinCode == temp.BinCode select r).FirstOrDefault();
                                    if (existInThePlan != null)
                                    {
                                        ThirdLevelNode.Checked = true;
                                        if (ThirdLevelNode.Parent != null)//如果节点上级不为空则展开该节点
                                        {
                                            ThirdLevelNode.Parent.Expand();
                                            if (ThirdLevelNode.Parent.Parent != null)
                                            {
                                                ThirdLevelNode.Parent.Parent.Expand();
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    //将数据导入到TreeView中
                    foreach (var binCodeFirstLetter in BinCodeFirstLetterList)
                    {
                        TreeNode FirstLevelNode = new TreeNode(binCodeFirstLetter.BinShort, binCodeFirstLetter.BinShort);
                        FirstLevelNode.Collapse();

                        var TempBinCodeTotalCodeList = (from r in BinCodeTotalCodeList where r.StartsWith(binCodeFirstLetter.BinShort) select r);
                        foreach (var binCodeTotalCode in TempBinCodeTotalCodeList)
                        {
                            TreeNode SecondLevelNode = new TreeNode(binCodeTotalCode, binCodeTotalCode);

                            var TempCargoTagBinCodeAndNumberList = (from r in CargoTagBinCodeAndNumberList where r.BinCode.StartsWith(binCodeTotalCode) select r);
                            foreach (var temp in TempCargoTagBinCodeAndNumberList)
                            {
                                string ShowName = temp.BinCode + "&nbsp;&nbsp;[现存" + (temp.Number == null ? "0" : temp.Number.Value.ToString()).PadLeft(5, ' ') + "枚]";

                                TreeNode ThirdLevelNode = new TreeNode(ShowName, temp.BinCode);
                                SecondLevelNode.ChildNodes.Add(ThirdLevelNode);
                            }

                            FirstLevelNode.ChildNodes.Add(SecondLevelNode);
                        }
                        TreeView_Scope.Nodes.Add(FirstLevelNode);
                    }
                }
            }
        }
Example #8
0
        private void LoadInfo(string ItemID)
        {
            using (GoldEntities context = new GoldEntities())
            {
                //绑定存提状态
                List <NameValueModel> ListPickOrStore = Gold.Utility.EnumData.GetEnumsList(typeof(Gold.Utility.EnumData.PickOrStore));
                DropDownList_StorePickType.Items.Clear();
                DropDownList_StorePickType.DataTextField  = "Name";
                DropDownList_StorePickType.DataValueField = "Value";
                DropDownList_StorePickType.DataSource     = ListPickOrStore;
                DropDownList_StorePickType.DataBind();
                DropDownList_StorePickType.Items.Insert(0, new ListItem("", ""));

                //绑定包装
                var result = (from r in context.Packages select new { r.PackageId, r.PackageName }).OrderBy(r => r.PackageName).ToList();
                DropDownList_PackageName.Items.Clear();
                DropDownList_PackageName.DataTextField  = "PackageName";
                DropDownList_PackageName.DataValueField = "PackageId";
                DropDownList_PackageName.DataSource     = result;
                DropDownList_PackageName.DataBind();
                DropDownList_PackageName.Items.Insert(0, new ListItem("", ""));

                //绑定仓库
                var resultWH = (from r in context.WareHouse select new { r.WHCode, r.WHName }).OrderBy(r => r.WHCode).ToList();
                DropDownList_WHCode.Items.Clear();
                DropDownList_WHCode.DataTextField  = "WHName";
                DropDownList_WHCode.DataValueField = "WHCode";
                DropDownList_WHCode.DataSource     = resultWH;
                DropDownList_WHCode.DataBind();
                DropDownList_WHCode.Items.Insert(0, new ListItem("", ""));


                //编辑状态下进入此页面时
                if (ItemID != "-1")
                {
                    tbxCargoCode.Enabled               = false;
                    tbxCargoName.Enabled               = false;
                    btnSelectCargo1.Enabled            = false;
                    btnSelectCargo2.Enabled            = false;
                    DropDownList_WHCode.Enabled        = false;
                    DropDownList_StorePickType.Enabled = false;
                    btnAccountNumberOld.Visible        = false;
                    btnComputeNewNumber.Visible        = false;
                    tbxStorePickNumber.Enabled         = false;
                    tbxAccountNumberNew.Enabled        = false;
                    tbxFactCheckNumberNew.Enabled      = false;
                    tbxIsProfitOrLostNew.Enabled       = false;

                    int ItemIDInt = int.Parse(ItemID);

                    StorePickAccount existModel = (from r in context.StorePickAccount where r.StockPickAccountID == ItemIDInt select r).FirstOrDefault();
                    if (existModel != null)
                    {
                        string storePickType = existModel.StorePickType;
                        DropDownList_StorePickType.SelectedIndex = DropDownList_StorePickType.Items.IndexOf(DropDownList_StorePickType.Items.FindByValue(storePickType));
                        tbxStorePickNumber.Text           = existModel.StorePickNumber.ToString();
                        DropDownList_WHCode.SelectedIndex = DropDownList_WHCode.Items.IndexOf(DropDownList_WHCode.Items.FindByValue(existModel.WHCode));
                        tbxCargoCode.Text = existModel.CargoCode;
                        tbxCargoName.Text = existModel.CargoName;

                        tbxStorePickNumber.Text    = existModel.StorePickNumber.ToString();
                        tbxAccountNumberOld.Text   = existModel.AccountNumber.ToString();
                        tbxFactCheckNumberOld.Text = existModel.FactCheckNumber.ToString();
                        tbxIsProfitOrLostOld.Text  = existModel.IsProfitOrLoss.ToString();
                        //编辑时数据一致
                        tbxAccountNumberNew.Text   = existModel.AccountNumber.ToString();
                        tbxFactCheckNumberNew.Text = existModel.FactCheckNumber.ToString();
                        tbxIsProfitOrLostNew.Text  = existModel.IsProfitOrLoss.ToString();

                        DropDownList_PackageName.SelectedIndex = DropDownList_PackageName.Items.IndexOf(DropDownList_PackageName.Items.FindByText(existModel.PackageName));
                        tbxPackageCount.Text         = existModel.PackageCount.Value.ToString();
                        tbxStandardCountEachBag.Text = existModel.StandardCountEachBag.Value.ToString();
                        tbxPackageNoStart.Text       = existModel.PackageNoStart;
                        tbxPackageNoEnd.Text         = existModel.PackageNoEnd;
                        tbxStoreDescription.Text     = existModel.StoreDescription;
                        tbxRemark.Text         = existModel.Remark;
                        tbxPackageLockNo.Text  = existModel.PackageLockNo;
                        tbxPackageShareNo.Text = existModel.PackageShareNo;
                        tbxRecordDetail.Text   = existModel.RecordDetail;
                        lblRecordTime.Text     = existModel.RecordTime.ToString();
                        lblRecordMonth.Text    = existModel.RecordMonth;
                    }
                }
            }
        }