예제 #1
0
        public override bool Equals(object obj)
        {
            CodeDetail another = obj as CodeDetail;

            if (another == null)
            {
                return(false);
            }
            else
            {
                return(this.Id == another.Id);
            }
        }
예제 #2
0
        public IList<CodeDetail> GetCodeDetails(com.Sconit.CodeMaster.CodeMaster code, bool? includeBlankOption, string blankOptionDescription, string blankOptionValue)
        {
            IList<CodeDetail> codeDetailList = this.GetCodeDetails(code);

            if(includeBlankOption.HasValue && includeBlankOption.Value)
            {
                CodeDetail blankCodeDetail = new CodeDetail();
                blankCodeDetail.Description = blankOptionDescription != null ? blankOptionDescription : string.Empty;
                blankCodeDetail.Value = blankOptionValue != null ? blankOptionValue : string.Empty;
                codeDetailList.Insert(0, blankCodeDetail);
            }

            return codeDetailList;
        }
예제 #3
0
        public ActionResult _ProdLineTypeDropDownList(string controlName, string controlId, string selectedValue, bool? includeBlankOption, string blankOptionDescription, string blankOptionValue, bool? enable, bool? isAssemblyFlow)
        {
            ViewBag.ControlName = controlName;
            ViewBag.ControlId = controlId;
            ViewBag.Enable = enable;
            ViewBag.isAssemblyFlow = isAssemblyFlow;
            IList<CodeDetail> getList = new List<CodeDetail>();
            getList = systemMgr.GetCodeDetails(Sconit.CodeMaster.CodeMaster.ProdLineType, includeBlankOption, blankOptionDescription, blankOptionValue);
            if (includeBlankOption.HasValue && includeBlankOption.Value)
            {
                CodeDetail codeDetail = new CodeDetail();
                codeDetail.Description = blankOptionDescription;
                codeDetail.Value = blankOptionValue;

                getList.Insert(0, codeDetail);
            }
            return PartialView(base.Transfer2DropDownList(Sconit.CodeMaster.CodeMaster.ProdLineType, getList, selectedValue));
        }
예제 #4
0
        public ActionResult _CodeMasterDropDownList(com.Sconit.CodeMaster.CodeMaster code, string controlName, string controlId, string selectedValue, string ajaxActionName, bool? isSupplier,
            //string[] parentCascadeControlNames, string[] cascadingControlNames,
                                                    bool? includeBlankOption, string blankOptionDescription, string blankOptionValue, bool? enable, bool? isConsignment, bool? isShowNA, int? orderType)
        {
            IList<CodeDetail> codeDetailList = systemMgr.GetCodeDetails(code, includeBlankOption, blankOptionDescription, blankOptionValue);

            //IList<object> para = new List<object>();
            //para.Add(com.Sconit.CodeMaster.CodeMaster.OrderStatus);
            //para.Add((int)com.Sconit.CodeMaster.OrderStatus.Create);
            //codeDetailList = systemMgr.GetCodeDetails(code, includeBlankOption, blankOptionDescription, blankOptionValue);
            //IList<CodeDetail> codeDetail = base.genericMgr.FindAll<CodeDetail>("from CodeDetail c where c.Code  = ? and c.Value=?", para.ToArray());
            //if (codeDetail.Count > 0)
            //{
            //    codeDetailList.Remove(codeDetail[0]);
            //}
            //    if (codeDetailList != null && codeDetailList.Count > 0)
            //    {
            //        codeDetailList = codeDetailList.Where(q => q.Value != ((int)com.Sconit.CodeMaster.OrderStatus.Create).ToString()).ToList();
            //    }
            //}
            //else
            //{

            if (isSupplier != null && isSupplier.Value)
            {
                codeDetailList = codeDetailList.Where(q => q.Value != ((int)com.Sconit.CodeMaster.OrderStatus.Create).ToString()).ToList();
            }
            //base.genericMgr.FindAll<CodeDetail>("from CodeDetail c where c.code = 'OrderStatus' and c.value in ('1','2')");
            //systemMgr.GetCodeDetails(code, includeBlankOption, blankOptionDescription, blankOptionValue);
            //采购路线中的结算方式 不显示寄售结算  
            if (isConsignment != null)
            {
                if (code == com.Sconit.CodeMaster.CodeMaster.BillTerm)
                {
                    if ((bool)isConsignment)
                    {
                        // codeDetailList = base.genericMgr.FindAll<CodeDetail>("from CodeDetail c where c.Description in ('" + "CodeDetail_BillTerm_BAC" + "','" + "CodeDetail_BillTerm_NA" + "','" + "CodeDetail_BillTerm_BAR" + "') order by c.Sequence");
                        codeDetailList = codeDetailList.Where(p => p.Value == ((int)com.Sconit.CodeMaster.OrderBillTerm.ConsignmentBilling).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderBillTerm.NA).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderBillTerm.ReceivingSettlement).ToString()).ToList();
                    }
                    else
                    {
                        codeDetailList = codeDetailList.Where(p => p.Value != ((int)com.Sconit.CodeMaster.OrderBillTerm.ConsignmentBilling).ToString()).ToList();
                    }
                    if (isShowNA != null)
                    {
                        if (!(bool)isShowNA)
                        {
                            codeDetailList = codeDetailList.Where(p => p.Value != ((int)com.Sconit.CodeMaster.OrderBillTerm.NA).ToString()).ToList();
                            //IList<CodeDetail> codeDetail = base.genericMgr.FindAll<CodeDetail>("from CodeDetail c where c.Description = ?", "CodeDetail_BillTerm_NA");
                            //if (codeDetail.Count > 0)
                            //{
                            //    codeDetailList.Remove(codeDetail[0]);
                            //}
                        }
                    }
                }
            }

            //收货和发货的OrderType 不显示销售和生产
            if (code == com.Sconit.CodeMaster.CodeMaster.OrderType)
            {
                //if (controlName == "GoodsReceiptOrderType" || controlName == "IpOrderType")
                //{
                //    IList<CodeDetail> codeDetail = base.genericMgr.FindAll<CodeDetail>("from CodeDetail c where c.Description = ? or c.Description=?",
                //        new object[] { "CodeDetail_OrderType_Distribution", "CodeDetail_OrderType_Production" });
                //    if (codeDetail.Count > 0)
                //    {
                //        for (int i = 0; i < codeDetail.Count; i++)
                //        {
                //            codeDetailList.Remove(codeDetail[i]);
                //        }
                //    }
                //}
                if (orderType != null)
                {
                    codeDetailList = systemMgr.GetCodeDetails(code);
                    if (orderType.Value == (int)com.Sconit.CodeMaster.OrderType.Production)
                    {
                        codeDetailList = codeDetailList.Where(p => p.Value == ((int)com.Sconit.CodeMaster.OrderType.Production).ToString()).ToList();
                        //   base.genericMgr.FindAll<CodeDetail>("from CodeDetail as c where c.Code = ? and c.Value = ?", new object[] { com.Sconit.CodeMaster.CodeMaster.OrderType.ToString(), (int)com.Sconit.CodeMaster.OrderType.Production });
                    }
                    if (orderType.Value == (int)com.Sconit.CodeMaster.OrderType.Procurement)
                    {
                        if (isSupplier != null && isSupplier.Value)
                        {
                            codeDetailList = codeDetailList.Where(p => p.Value == ((int)com.Sconit.CodeMaster.OrderType.Procurement).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.CustomerGoods).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.SubContract).ToString()).ToList();
                            //base.genericMgr.FindAll<CodeDetail>("from CodeDetail as c where c.Code = ? and c.Value in (?,?,?)", new object[] { com.Sconit.CodeMaster.CodeMaster.OrderType.ToString(), (int)com.Sconit.CodeMaster.OrderType.Procurement, (int)com.Sconit.CodeMaster.OrderType.CustomerGoods, (int)com.Sconit.CodeMaster.OrderType.SubContract });
                        }
                        else
                        {
                            codeDetailList = codeDetailList.Where(p => p.Value == ((int)com.Sconit.CodeMaster.OrderType.Procurement).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.CustomerGoods).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.Transfer).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.SubContractTransfer).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.ScheduleLine).ToString()).ToList();
                            // codeDetailList = base.genericMgr.FindAll<CodeDetail>("from CodeDetail as c where c.Code = ? and c.Value in (?,?,?,?,?,?)", new object[] { com.Sconit.CodeMaster.CodeMaster.OrderType.ToString(), (int)com.Sconit.CodeMaster.OrderType.Procurement, (int)com.Sconit.CodeMaster.OrderType.SubContract, (int)com.Sconit.CodeMaster.OrderType.CustomerGoods, (int)com.Sconit.CodeMaster.OrderType.Transfer, (int)com.Sconit.CodeMaster.OrderType.SubContractTransfer, (int)com.Sconit.CodeMaster.OrderType.ScheduleLine });
                        }
                    }
                    if (orderType.Value == (int)com.Sconit.CodeMaster.OrderType.Distribution)
                    {
                        codeDetailList = codeDetailList.Where(p => p.Value == ((int)com.Sconit.CodeMaster.OrderType.Distribution).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.Transfer).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.SubContractTransfer).ToString()).ToList();
                        //base.genericMgr.FindAll<CodeDetail>("from CodeDetail as c where c.Code = ? and c.Value in (?,?,?)", new object[] { com.Sconit.CodeMaster.CodeMaster.OrderType.ToString(), (int)com.Sconit.CodeMaster.OrderType.Distribution, (int)com.Sconit.CodeMaster.OrderType.Transfer, (int)com.Sconit.CodeMaster.OrderType.SubContractTransfer });
                    }

                    #region empty codedetail
                    CodeDetail emptyCodeDetail = new CodeDetail();
                    emptyCodeDetail.Value = blankOptionValue;
                    emptyCodeDetail.Description = blankOptionDescription;
                    codeDetailList.Insert(0, emptyCodeDetail);
                    #endregion
                }
            }
            ViewBag.ControlName = controlName;
            ViewBag.ControlId = controlId;
            //ViewBag.SelectedValue = selectedValue;
            ViewBag.AjaxActionName = ajaxActionName;

            ViewBag.Enable = enable;
            // codeDetailList.Add(new CodeDetail());
            //ViewBag.CascadingControlNames = cascadingControlNames;
            //ViewBag.ParentCascadeControlNames = parentCascadeControlNames;
            if (code == com.Sconit.CodeMaster.CodeMaster.FlowStrategy)
            {
                codeDetailList = codeDetailList.Where(c => c.Description != "CodeDetail_FlowStrategy_NA").ToList();
            }
            return PartialView(base.Transfer2DropDownList(code, codeDetailList, selectedValue));
        }
예제 #5
0
        public ActionResult _CodeMasterDropDownList(com.Sconit.CodeMaster.CodeMaster code, string controlName, string controlId, string selectedValue, string ajaxActionName, bool? isSupplier,
             bool? includeBlankOption, string blankOptionDescription, string blankOptionValue, bool? enable, bool? isConsignment, bool? isShowNA, int? orderType, bool? isWidth)
        {
            IList<CodeDetail> codeDetailList = systemMgr.GetCodeDetails(code, includeBlankOption, blankOptionDescription, blankOptionValue);
            if (controlName == "ExcelTemplate")
            {
                string defaultpara = code.ToString();
                //DataSet ds = genericMgr.GetDatasetBySql(@"select distinct code from sys_codedet where value like '%xls'", null);
                //List<string> MultiCode = new List<string>();
                //foreach (DataRow dr in ds.Tables[0].Rows)
                //{
                //    MultiCode.Add(dr.ItemArray[0].ToString());
                //}

                var multiCodes = this.genericMgr.FindAllWithNativeSql<string>("select distinct code from sys_codedet where value like '%xls'");

                IList<CodeDetail> MulticodeDetailList = systemMgr.GetMultiCodeDetails(multiCodes, includeBlankOption, blankOptionDescription, blankOptionValue);
                codeDetailList = MulticodeDetailList;
            }
            if (isSupplier != null && isSupplier.Value)
            {
                codeDetailList = codeDetailList.Where(q => q.Value != ((int)com.Sconit.CodeMaster.OrderStatus.Create).ToString()).ToList();
            }

            //采购路线中的结算方式 不显示寄售结算  
            if (isConsignment != null)
            {
                if (code == com.Sconit.CodeMaster.CodeMaster.OrderBillTerm)
                {
                    if ((bool)isConsignment)
                    {
                        codeDetailList = codeDetailList.Where(p => p.Value == ((int)com.Sconit.CodeMaster.OrderBillTerm.ConsignmentBilling).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderBillTerm.NA).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderBillTerm.ReceivingSettlement).ToString()).ToList();
                    }
                    else
                    {
                        codeDetailList = codeDetailList.Where(p => p.Value != ((int)com.Sconit.CodeMaster.OrderBillTerm.ConsignmentBilling).ToString()).ToList();
                    }
                    if (isShowNA != null)
                    {
                        if (!(bool)isShowNA)
                        {
                            codeDetailList = codeDetailList.Where(p => p.Value != ((int)com.Sconit.CodeMaster.OrderBillTerm.NA).ToString()).ToList();
                        }
                    }
                }
            }

            //收货和发货的OrderType 不显示销售和生产
            if (code == com.Sconit.CodeMaster.CodeMaster.OrderType)
            {
                if (orderType != null)
                {
                    //codeDetailList = systemMgr.GetCodeDetails(code);
                    if (orderType.Value == (int)com.Sconit.CodeMaster.OrderType.Production)
                    {
                        codeDetailList = codeDetailList.Where(p => p.Value == ((int)com.Sconit.CodeMaster.OrderType.Production).ToString()).ToList();
                    }
                    else if (orderType.Value == (int)com.Sconit.CodeMaster.OrderType.Procurement)
                    {
                        if (isSupplier != null && isSupplier.Value)
                        {
                            codeDetailList = codeDetailList.Where(p => p.Value == ((int)com.Sconit.CodeMaster.OrderType.Procurement).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.CustomerGoods).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.SubContract).ToString()).ToList();
                        }
                        else
                        {
                            codeDetailList = codeDetailList.Where(p => p.Value == ((int)com.Sconit.CodeMaster.OrderType.Procurement).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.CustomerGoods).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.Transfer).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.SubContractTransfer).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.SubContract).ToString()).ToList();
                        }
                    }
                    else if (orderType.Value == (int)com.Sconit.CodeMaster.OrderType.Distribution)
                    {
                        if (controlName == "IpReportType")
                        {
                            codeDetailList = codeDetailList.Where(p => p.Value == ((int)com.Sconit.CodeMaster.OrderType.Distribution).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.Transfer).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.Procurement).ToString()).ToList();

                        }
                        else
                        {
                            codeDetailList = codeDetailList.Where(p => p.Value == ((int)com.Sconit.CodeMaster.OrderType.Distribution).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.Transfer).ToString() || p.Value == ((int)com.Sconit.CodeMaster.OrderType.SubContractTransfer).ToString()).ToList();
                        }
                    }

                    #region empty codedetail
                    if (includeBlankOption.HasValue && includeBlankOption.Value)
                    {
                        CodeDetail emptyCodeDetail = new CodeDetail();
                        emptyCodeDetail.Value = blankOptionValue;
                        emptyCodeDetail.Description = blankOptionDescription;
                        codeDetailList.Insert(0, emptyCodeDetail);
                    }
                    #endregion
                }
            }
            else if (code == com.Sconit.CodeMaster.CodeMaster.OrderSubType)
            {
                if(orderType.HasValue && orderType.Value == (int)com.Sconit.CodeMaster.OrderType.Production)
                {
                    codeDetailList = codeDetailList.Where(p =>
                        p.Value != ((int)com.Sconit.CodeMaster.OrderSubType.Return).ToString())
                        .ToList();
                }
                else
                {
                    codeDetailList = codeDetailList.Where(p =>
                          p.Value != ((int)com.Sconit.CodeMaster.OrderSubType.Other).ToString())
                          .ToList();
                }
            }
            else if (code == com.Sconit.CodeMaster.CodeMaster.HandleResult)
            {
                codeDetailList = codeDetailList.Where(p => p.Value != ((int)com.Sconit.CodeMaster.HandleResult.Qualify).ToString()).ToList();
            }
            else if (code == Sconit.CodeMaster.CodeMaster.QualityType)
            {
                codeDetailList = codeDetailList.Where(p => p.Value != ((int)com.Sconit.CodeMaster.QualityType.Inspect).ToString()).ToList();
            }
            else if(code == Sconit.CodeMaster.CodeMaster.ScheduleType)
            {
                codeDetailList = codeDetailList.Where(p => p.Sequence > 100).ToList();
            }
            else if (code == Sconit.CodeMaster.CodeMaster.OrderBillTerm)
            {
                //codeDetailList = codeDetailList.Where(p => p.Value != ((int)com.Sconit.CodeMaster.OrderBillTerm.ConsignmentBilling).ToString()).ToList();
            }
            ViewBag.ControlName = controlName;
            ViewBag.ControlId = controlId;
            //ViewBag.SelectedValue = selectedValue;
            ViewBag.AjaxActionName = ajaxActionName;
            ViewBag.isWidth = isWidth;
            ViewBag.Enable = enable;
            // codeDetailList.Add(new CodeDetail());
            //ViewBag.CascadingControlNames = cascadingControlNames;
            //ViewBag.ParentCascadeControlNames = parentCascadeControlNames;
            return PartialView(base.Transfer2DropDownList(code, codeDetailList, selectedValue));
        }