public int VerifyInDepot(int MainID, bool t, int TableTypeID) { Hownet.BLL.AmountInfo bllAI = new AmountInfo(); Hownet.BLL.Materiel bllMat = new Materiel(); Hownet.Model.ProductTaskMain modPTM = GetModel(MainID); List <Hownet.Model.AmountInfo> liAI = bllAI.DataTableToList(bllAI.GetList("(MainID=" + MainID + ") And (TableTypeID=" + TableTypeID + ")").Tables[0]); Hownet.BLL.Repertory bllRe = new Repertory(); Hownet.Model.Repertory modRe; Hownet.Model.Materiel modMat = bllMat.GetModel(modPTM.MaterielID); int a = 0; if (liAI.Count > 0) { for (int i = 0; i < liAI.Count; i++) { modRe = new Model.Repertory(); modRe.Amount = liAI[i].Amount; modRe.BrandID = modPTM.BrandID; modRe.ColorID = liAI[i].ColorID; modRe.ColorOneID = liAI[i].ColorOneID; modRe.ColorTwoID = liAI[i].ColorTwoID; modRe.DepartmentID = modPTM.DeparmentID; modRe.MaterielID = modPTM.MaterielID; modRe.MeasureID = modMat.MeasureID; modRe.MListID = liAI[i].MListID; modRe.SizeID = liAI[i].SizeID; bllRe.InOrOut(modRe, t); } } return(a); }
/// <summary> /// 合并生产计划 /// </summary> /// <param name="StrPPID"></param> public int MergePP(string StrPPID) { Hownet.BLL.AmountInfo bllAI = new AmountInfo(); string[] ss = StrPPID.Split(','); int MainID = 0; Hownet.Model.ProductionPlan modPP = GetModel(Convert.ToInt32(ss[0])); modPP.TypeID = -1; modPP.DeparmentID = -1; modPP.UpData = 1; modPP.IsVerify = 1; MainID = Add(modPP); DataTable dt = dal.GetMergeAmount(StrPPID, (int)Enums.TableType.ProductionPlan).Tables[0]; DataTable dttt = dt.Clone(); Hownet.BLL.MaterielList bllML = new MaterielList(); Hownet.Model.MaterielList modML; Hownet.BLL.Materiel bllMat = new Materiel(); Hownet.Model.Materiel modMat = bllMat.GetModel(modPP.MaterielID); for (int i = 0; i < dt.Rows.Count; i++) { dttt.Rows.Clear(); dt.Rows[i]["MainID"] = MainID; modML = new Hownet.Model.MaterielList(); modML.BrandID = modPP.BrandID; modML.ColorID = Convert.ToInt32(dt.Rows[i]["ColorID"]); modML.ColorOneID = Convert.ToInt32(dt.Rows[i]["ColorOneID"]); modML.ColorTwoID = Convert.ToInt32(dt.Rows[i]["ColorTwoID"]); modML.MaterielID = modPP.MaterielID; modML.MeasureID = modMat.MeasureID; modML.SizeID = Convert.ToInt32(dt.Rows[i]["SizeID"]); dt.Rows[i]["MListID"] = modML.ID = bllML.GetID(modML); dttt.Rows.Add(dt.Rows[i].ItemArray); bllAI.AddByDt(dttt); } for (int i = 0; i < ss.Length; i++) { modPP = GetModel(Convert.ToInt32(ss[i])); modPP.DeparmentID = MainID; modPP.IsVerify = (int)Enums.IsVerify.合并或拆分; Update(modPP); } return(MainID); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Hownet.Model.Materiel model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Hownet.Model.Materiel model) { return(dal.Add(model)); }
/// <summary> /// 获得数据列表 /// </summary> public List <Hownet.Model.Materiel> DataTableToList(DataTable dt) { List <Hownet.Model.Materiel> modelList = new List <Hownet.Model.Materiel>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Hownet.Model.Materiel model; for (int n = 0; n < rowsCount; n++) { model = new Hownet.Model.Materiel(); if (dt.Rows[n]["ID"].ToString() != "") { model.ID = int.Parse(dt.Rows[n]["ID"].ToString()); } model.Name = dt.Rows[n]["Name"].ToString(); if (dt.Rows[n]["TypeID"].ToString() != "") { model.TypeID = int.Parse(dt.Rows[n]["TypeID"].ToString()); } if (dt.Rows[n]["MeasureID"].ToString() != "") { model.MeasureID = int.Parse(dt.Rows[n]["MeasureID"].ToString()); } model.Sn = dt.Rows[n]["Sn"].ToString(); model.Remark = dt.Rows[n]["Remark"].ToString(); if (dt.Rows[n]["AttributeID"].ToString() != "") { model.AttributeID = int.Parse(dt.Rows[n]["AttributeID"].ToString()); } if (dt.Rows[n]["SecondMeasureID"].ToString() != "") { model.SecondMeasureID = int.Parse(dt.Rows[n]["SecondMeasureID"].ToString()); } if (dt.Rows[n]["Conversion"].ToString() != "") { model.Conversion = decimal.Parse(dt.Rows[n]["Conversion"].ToString()); } if (dt.Rows[n]["IsEnd"].ToString() != "") { model.IsEnd = int.Parse(dt.Rows[n]["IsEnd"].ToString()); } if (dt.Rows[n]["IsUse"].ToString() != "") { if ((dt.Rows[n]["IsUse"].ToString() == "1") || (dt.Rows[n]["IsUse"].ToString().ToLower() == "true")) { model.IsUse = true; } else { model.IsUse = false; } } if (dt.Rows[n]["Designers"].ToString() != "") { model.Designers = int.Parse(dt.Rows[n]["Designers"].ToString()); } else { model.Designers = 0; } model.Image = dt.Rows[n]["Image"].ToString(); if (dt.Rows[n]["SelectSpec"].ToString() != "") { model.SelectSpec = int.Parse(dt.Rows[n]["SelectSpec"].ToString()); } model.TiaoMaH = dt.Rows[n]["TiaoMaH"].ToString(); if (dt.Rows[n]["ChengBengJ"] != null && dt.Rows[n]["ChengBengJ"].ToString() != "") { model.ChengBengJ = decimal.Parse(dt.Rows[n]["ChengBengJ"].ToString()); } if (dt.Rows[n]["LingShouJia"] != null && dt.Rows[n]["LingShouJia"].ToString() != "") { model.LingShouJia = decimal.Parse(dt.Rows[n]["LingShouJia"].ToString()); } if (dt.Rows[n]["YiJiDaiLiJia"] != null && dt.Rows[n]["YiJiDaiLiJia"].ToString() != "") { model.YiJiDaiLiJia = decimal.Parse(dt.Rows[n]["YiJiDaiLiJia"].ToString()); } if (dt.Rows[n]["ErJiDaiLiJia"] != null && dt.Rows[n]["ErJiDaiLiJia"].ToString() != "") { model.ErJiDaiLiJia = decimal.Parse(dt.Rows[n]["ErJiDaiLiJia"].ToString()); } if (dt.Rows[n]["SanJiDaiLiJia"] != null && dt.Rows[n]["SanJiDaiLiJia"].ToString() != "") { model.SanJiDaiLiJia = decimal.Parse(dt.Rows[n]["SanJiDaiLiJia"].ToString()); } modelList.Add(model); } } return(modelList); }
public DataSet GetSchedule(int TaskID, int MaterielID, DateTime dt1, DateTime dt2, int PWID) { Hownet.BLL.ProductWorkingInfo bllPWI = new ProductWorkingInfo(); Hownet.BLL.WorkTicketInfo bllWTI = new WorkTicketInfo(); Hownet.BLL.AmountInfo bllAI = new AmountInfo(); Hownet.BLL.OtherType bllOT = new OtherType(); Hownet.BLL.Materiel bllM = new Materiel(); DataTable dtOT = bllOT.GetTypeList("进度工序").Tables[0]; DataTable dt = new DataTable(); dt.TableName = "dt"; dt.Columns.Add("款号", typeof(string)); dt.Columns.Add("颜色", typeof(int)); dt.Columns.Add("尺码", typeof(int)); dt.Columns.Add("未领", typeof(int)); for (int i = 0; i < dtOT.Rows.Count; i++) { dt.Columns.Add(dtOT.Rows[i]["Name"].ToString(), typeof(int)); } dt.Columns.Add("合计", typeof(int)); int _colCount = dt.Columns.Count; int _Amount = 0; int _aaa = 0; DataSet ds = new DataSet(); ds.DataSetName = "ds"; if (TaskID > 0) { #region 制单 Hownet.Model.ProductTaskMain modPTM = GetModel(TaskID); if (modPTM.IsTicket) { try { DataTable dtAI = bllAI.GetColorSize(TaskID, 1).Tables[0]; DataTable dtPWI = bllPWI.GetTopList(1, "(MainID=" + modPTM.PWorkingID + ") And (IsTicket=1)", "Orders").Tables[0]; Hownet.Model.Materiel modM = bllM.GetModel(modPTM.MaterielID); for (int i = 0; i < dtAI.Rows.Count; i++) { _Amount = 0; DataRow dr = dt.NewRow(); dr["款号"] = modM.Name; dr["颜色"] = dtAI.Rows[i]["ColorID"]; dr["尺码"] = dtAI.Rows[i]["SizeID"]; _aaa = bllWTI.GetNotAmountByOrders(TaskID, Convert.ToInt32(dtAI.Rows[i]["ColorID"]), Convert.ToInt32(dtAI.Rows[i]["SizeID"]), Convert.ToInt32(dtPWI.Rows[0]["WorkingID"])); if (_aaa > 0) { dr["未领"] = _Amount = _aaa; } else { dr["未领"] = DBNull.Value; } for (int j = 0; j < dtOT.Rows.Count; j++) { _aaa = bllWTI.GetNotAmountByOrders(TaskID, Convert.ToInt32(dtAI.Rows[i]["ColorID"]), Convert.ToInt32(dtAI.Rows[i]["SizeID"]), Convert.ToInt32(dtOT.Rows[j]["Value"])); if (_aaa > 0) { dr[j + 4] = _aaa; } else { dr[j + 4] = DBNull.Value; } _Amount += _aaa; } dr[_colCount - 1] = _Amount; dt.Rows.Add(dr); } DataRow drr = dt.NewRow(); drr[0] = modM.Name + "小计"; drr[1] = 0; drr[2] = 0; _Amount = 0; for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i][3].ToString() != string.Empty) { _Amount += Convert.ToInt32(dt.Rows[i][3]); } } drr[3] = _Amount; // _Amount=0; for (int i = 0; i < dtOT.Rows.Count; i++) { drr[i + 4] = bllWTI.GetNotAmountByOrders(TaskID, 0, 0, Convert.ToInt32(dtOT.Rows[i]["Value"])); _Amount += Convert.ToInt32(drr[i + 4]); } drr[_colCount - 1] = _Amount; dt.Rows.Add(drr); ds.Tables.Add(dt); } catch (Exception ex) { } } #endregion } else if (MaterielID > 0) { try { DataTable dtAI = GetSumAmount(dt1, dt2, MaterielID, PWID).Tables[0]; DataTable dtPWI = bllPWI.GetTopList(1, "(MainID=" + PWID + ") And (IsTicket=1)", "Orders").Tables[0]; Hownet.Model.Materiel modM = bllM.GetModel(MaterielID); for (int i = 0; i < dtAI.Rows.Count; i++) { _Amount = 0; DataRow dr = dt.NewRow(); dr["款号"] = modM.Name; dr["颜色"] = dtAI.Rows[i]["ColorID"]; dr["尺码"] = dtAI.Rows[i]["SizeID"]; _aaa = bllWTI.GetNotAmountByMateriel(dt1, dt2, MaterielID, Convert.ToInt32(dtAI.Rows[i]["ColorID"]), Convert.ToInt32(dtAI.Rows[i]["SizeID"]), Convert.ToInt32(dtPWI.Rows[0]["WorkingID"])); if (_aaa > 0) { dr["未领"] = _Amount = _aaa; } else { dr["未领"] = DBNull.Value; } for (int j = 0; j < dtOT.Rows.Count; j++) { _aaa = bllWTI.GetNotAmountByMateriel(dt1, dt2, MaterielID, Convert.ToInt32(dtAI.Rows[i]["ColorID"]), Convert.ToInt32(dtAI.Rows[i]["SizeID"]), Convert.ToInt32(dtOT.Rows[j]["Value"])); if (_aaa > 0) { dr[j + 4] = _aaa; } else { dr[j + 4] = DBNull.Value; } _Amount += _aaa; } dr[_colCount - 1] = _Amount; dt.Rows.Add(dr); } DataRow drr = dt.NewRow(); drr[0] = modM.Name + "小计"; drr[1] = 0; drr[2] = 0; _Amount = 0; for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i][3].ToString() != string.Empty) { _Amount += Convert.ToInt32(dt.Rows[i][3]); } } drr[3] = _Amount; // _Amount=0; for (int i = 0; i < dtOT.Rows.Count; i++) { drr[i + 4] = bllWTI.GetNotAmountByMateriel(dt1, dt2, MaterielID, 0, 0, Convert.ToInt32(dtOT.Rows[i]["Value"])); _Amount += Convert.ToInt32(drr[i + 4]); } drr[_colCount - 1] = _Amount; dt.Rows.Add(drr); ds.Tables.Add(dt); } catch (Exception ex) { } } return(ds); }
public void Save(byte[] bb, int ProductWorkID, int TaskID) { DataTable Main = Hownet.BLL.BaseFile.ZipDt.Byte2Ds(bb).Tables[0]; Main.Columns.Add("OneAmount", typeof(int)); for (int i = 0; i < Main.Rows.Count; i++) { Main.Rows[i]["OneAmount"] = 0; } Hownet.BLL.ProductWorkingInfo bllPWI = new ProductWorkingInfo(); Hownet.BLL.WorkTicket bllWT = new WorkTicket(); Hownet.BLL.WorkTicketInfo bllWkInfo = new WorkTicketInfo(); Hownet.Model.WorkTicket modWK = new Hownet.Model.WorkTicket(); Hownet.Model.WorkTicketInfo modWKI = new Hownet.Model.WorkTicketInfo(); Hownet.BLL.ProductTaskMain bllPTM = new ProductTaskMain(); Hownet.Model.ProductTaskMain modPTM = bllPTM.GetModel(TaskID); Hownet.BLL.AmountInfo bllPTI = new AmountInfo(); Hownet.BLL.MaterielList bllML = new MaterielList(); Hownet.Model.MaterielList modML = new Hownet.Model.MaterielList(); Hownet.BLL.Materiel bllMat = new Materiel(); Hownet.Model.Materiel modMat = bllMat.GetModel(modPTM.MaterielID); DataTable dtInfo = bllWkInfo.GetListNoA("(ID=0)").Tables[0]; //DataSet dsPt = bllPTI.GetBoxID(TaskID, 1); //DataTable dtPWIAmount = bllPWI.GetOneAmount(ProductWorkID).Tables[0]; //int _PJAmount = 0, _WAmount = 0; ////dtTem.Columns.Add("ColorID", typeof(string)); //// dtTem.Columns.Add("SizeID", typeof(string)); //// dtTem.Columns.Add("Amount", typeof(string)); //// dtTem.Columns.Add("BoxNum", typeof(string)); //int BoxNum = Main.Rows.Count + 1; //int z = 0; //int j = 0; //for (int g = 0; g < dtPWIAmount.Rows.Count; g++) //{ // #region 有预设数量分箱 // if (Convert.ToInt32(dtPWIAmount.Rows[g]["OneAmount"]) > 0) // { // _PJAmount = Convert.ToInt32(dtPWIAmount.Rows[g]["OneAmount"]); // _WAmount = Convert.ToInt32(_PJAmount * 1.5); // for (int r = 0; r < dsPt.Tables[0].Rows.Count; r++) // { // //某数量少于尾箱数量,直接取该数量 // if (int.Parse(dsPt.Tables[0].DefaultView[r]["Amount"].ToString()) < _WAmount) // { // Main.Rows.Add(dsPt.Tables[0].DefaultView[r]["ColorID"], dsPt.Tables[0].DefaultView[r]["SizeID"], // dsPt.Tables[0].DefaultView[r]["Amount"], BoxNum, _PJAmount); // BoxNum++; // } // else // { // int x = int.Parse(dsPt.Tables[0].DefaultView[r]["Amount"].ToString()) % _PJAmount; // if (x <= (_WAmount - _PJAmount)) // { // z = 3; // } // if (x == 0) // { // z = 1; // } // if (x > (_WAmount - _PJAmount)) // { // z = 2; // } // switch (z) // { // case 1: // { // for (j = BoxNum; j < (BoxNum + (int.Parse(dsPt.Tables[0].DefaultView[r]["Amount"].ToString()) / _PJAmount)); j++) // { // Main.Rows.Add(dsPt.Tables[0].DefaultView[r]["ColorID"], dsPt.Tables[0].DefaultView[r]["SizeID"], _PJAmount, // j, _PJAmount); // } // BoxNum = j; // break; // } // case 2: // { // for (j = BoxNum; j < (BoxNum + int.Parse(dsPt.Tables[0].DefaultView[r]["Amount"].ToString()) / _PJAmount); j++) // { // Main.Rows.Add(dsPt.Tables[0].DefaultView[r]["ColorID"], // dsPt.Tables[0].DefaultView[r]["SizeID"], _PJAmount, j, _PJAmount); // } // Main.Rows.Add(dsPt.Tables[0].DefaultView[r]["ColorID"], dsPt.Tables[0].DefaultView[r]["SizeID"], x, j, _PJAmount); // BoxNum = j + 1; // break; // } // case 3: // { // for (j = BoxNum; j < (BoxNum + int.Parse(dsPt.Tables[0].DefaultView[r]["Amount"].ToString()) / _PJAmount) - 1; j++) // { // // A,ID,ColorID,ColorOneID,ColorTwoID,SizeID,Amount,BoxNum,TaskID,DepartmentID,P2DInfoID,EligibleAmount,InferiorAmount,P2DDepartmentID,MListID,BrandID // Main.Rows.Add(dsPt.Tables[0].DefaultView[r]["ColorID"], dsPt.Tables[0].DefaultView[r]["SizeID"], _PJAmount, j, _PJAmount); // } // Main.Rows.Add(dsPt.Tables[0].DefaultView[r]["ColorID"], dsPt.Tables[0].DefaultView[r]["SizeID"], (_PJAmount + x), // j, _PJAmount); // BoxNum = j + 1; // break; // } // } // } // } // } // #endregion // #region 各色各码总数分为一箱 // if (Convert.ToInt32(dtPWIAmount.Rows[g]["OneAmount"]) == -1) // { // for (int r = 0; r < dsPt.Tables[0].Rows.Count; r++) // { // Main.Rows.Add(dsPt.Tables[0].DefaultView[r]["ColorID"], dsPt.Tables[0].DefaultView[r]["SizeID"], // dsPt.Tables[0].DefaultView[r]["Amount"], BoxNum, -1); // BoxNum++; // } // } // #endregion //} try { bool t = false; DataSet dsPw = bllPWI.GetBoxWork(ProductWorkID); DataTable dtSpecial = bllPWI.GetList("(MainID=" + ProductWorkID * -1 + ")").Tables[0];//查出特殊工序明细表 DataRow[] ddrs; if (dtSpecial.Rows.Count == 0) { #region 没有特殊工序 for (int r = 0; r < Main.Rows.Count; r++) { modML = new Hownet.Model.MaterielList(); modML.ColorID = modWK.ColorID = int.Parse(Main.DefaultView[r]["ColorID"].ToString()); modML.SizeID = modWK.SizeID = int.Parse(Main.DefaultView[r]["SizeID"].ToString()); modML.ColorOneID = modWK.ColorOneID = Convert.ToInt32(Main.DefaultView[r]["ColorOneID"]); modML.ColorTwoID = modWK.ColorTwoID = Convert.ToInt32(Main.DefaultView[r]["ColorTwoID"]); modWK.BoxNum = int.Parse(Main.DefaultView[r]["BoxNum"].ToString()); modWK.Amount = int.Parse(Main.DefaultView[r]["Amount"].ToString()); modML.MaterielID = modPTM.MaterielID; modML.BrandID = modPTM.BrandID; modML.MeasureID = modMat.MeasureID; modWK.MListID = bllML.GetID(modML); modWK.TaskID = TaskID; modWK.DepartmentID = modPTM.DeparmentID; modWK.OneAmount = Convert.ToInt32(Main.DefaultView[r]["OneAmount"]); int mainID = bllWT.Add(modWK); ddrs = dsPw.Tables[0].Select("(OneAmount=" + modWK.OneAmount + ")"); for (int c = 0; c < ddrs.Length; c++) { modWKI.EmployeeID = 0; modWKI.PWorkingInfoID = int.Parse(ddrs[c]["ID"].ToString()); modWKI.WorkingID = int.Parse(ddrs[c]["WorkingID"].ToString()); modWKI.MainID = mainID; modWKI.OutAmount = modWKI.Amount = modWKI.NotAmount = modWK.Amount; modWKI.TaskID = TaskID; //bllWkInfo.Add(modWKI); dtInfo.Rows.Add(0, modWKI.MainID, modWKI.DateTime, modWKI.IsDel, modWKI.PWorkingInfoID, modWKI.EmployeeID, modWKI.BackID, modWKI.Amount, modWKI.NotAmount, modWKI.TaskID, modWKI.WorkingID, modWKI.OutAmount); } } } #endregion #region 特殊工序 else { DataRow[] drs; for (int r = 0; r < Main.Rows.Count; r++) { modML = new Hownet.Model.MaterielList(); modML.ColorID = modWK.ColorID = int.Parse(Main.DefaultView[r]["ColorID"].ToString()); modML.SizeID = modWK.SizeID = int.Parse(Main.DefaultView[r]["SizeID"].ToString()); modML.ColorOneID = modWK.ColorOneID = Convert.ToInt32(Main.DefaultView[r]["ColorOneID"]); modML.ColorTwoID = modWK.ColorTwoID = Convert.ToInt32(Main.DefaultView[r]["ColorTwoID"]); modWK.BoxNum = int.Parse(Main.DefaultView[r]["BoxNum"].ToString()); modWK.Amount = int.Parse(Main.DefaultView[r]["Amount"].ToString()); modML.MaterielID = modPTM.MaterielID; modML.BrandID = modPTM.BrandID; modML.MeasureID = modMat.MeasureID; modWK.MListID = bllML.GetID(modML); modWK.TaskID = TaskID; modWK.DepartmentID = modPTM.DeparmentID; modWK.OneAmount = Convert.ToInt32(Main.DefaultView[r]["OneAmount"]); int mainID = bllWT.Add(modWK); for (int c = 0; c < dsPw.Tables[0].Rows.Count; c++) { t = false; modWKI.EmployeeID = 0; int w = int.Parse(dsPw.Tables[0].DefaultView[c]["WorkingID"].ToString()); modWKI.WorkingID = w; modWKI.PWorkingInfoID = int.Parse(dsPw.Tables[0].DefaultView[c]["ID"].ToString()); if ((bool.Parse(dsPw.Tables[0].DefaultView[c]["IsSpecial"].ToString())))//判断某道工序是否是特殊工序 { //有特定客户、特定尺码、特定颜色的特殊工序 drs = dtSpecial.Select("(SpecialWork=" + w + ") and (CompanyID=" + modPTM.CompanyID + ") and (ColorID=" + Main.Rows[r]["ColorID"] + ") And (MaterielID=" + Main.Rows[r]["SizeID"] + ")"); if (drs.Length == 0) { //有特定尺码、特定颜色的特殊工序 drs = dtSpecial.Select("(SpecialWork=" + w + ") and (CompanyID=0) and (ColorID=" + Main.Rows[r]["ColorID"] + ") And (MaterielID=" + Main.Rows[r]["SizeID"] + ")"); if (drs.Length == 0) { //有特定尺码、特定客户的特殊工序 drs = dtSpecial.Select("(SpecialWork=" + w + ") and (CompanyID=" + modPTM.CompanyID + ") and (ColorID=0) And (MaterielID=" + Main.Rows[r]["SizeID"] + ")"); if (drs.Length == 0) { //有特定客户、特定颜色的特殊工序 drs = dtSpecial.Select("(SpecialWork=" + w + ") and (CompanyID=" + modPTM.CompanyID + ") and (ColorID=" + Main.Rows[r]["ColorID"] + ") And (MaterielID=0)"); if (drs.Length == 0) { //只有特定颜色的特殊工序 drs = dtSpecial.Select("(SpecialWork=" + w + ") and (MaterielID=0) And (CompanyID=0) and (ColorID=" + Main.Rows[r]["ColorID"] + ")"); if (drs.Length == 0) { //有只特定客户的特殊工序 drs = dtSpecial.Select("(SpecialWork=" + w + ") and (CompanyID=" + modPTM.CompanyID + ") and (ColorID=0) and (MaterielID=0)"); if (drs.Length == 0) { //有只特定尺码的特殊工序 drs = dtSpecial.Select("(SpecialWork=" + w + ") and (MaterielID=" + Main.Rows[r]["SizeID"] + ") and (ColorID=0) and (CompanyID=0)"); if (drs.Length == 0) { //不分颜色、客户的特殊工序 drs = dtSpecial.Select("(SpecialWork=" + w + ") and (CompanyID=0) and (ColorID=0)"); if (drs.Length == 0) { t = true; } } } } } } } } if (drs.Length > 0) { modWKI.WorkingID = int.Parse(drs[0]["WorkingID"].ToString()); modWKI.PWorkingInfoID = int.Parse(drs[0]["ID"].ToString()); if (modWKI.WorkingID == 0) { t = true; } } } modWKI.MainID = mainID; modWKI.OutAmount = modWKI.Amount = modWKI.NotAmount = modWK.Amount; modWKI.TaskID = TaskID; if (!t) { //bllWkInfo.Add(modWKI);//有特殊工序的普通工序,则添加记录,否则不添加 dtInfo.Rows.Add(0, modWKI.MainID, modWKI.DateTime, modWKI.IsDel, modWKI.PWorkingInfoID, modWKI.EmployeeID, modWKI.BackID, modWKI.Amount, modWKI.NotAmount, modWKI.TaskID, modWKI.WorkingID, modWKI.OutAmount); } } } } #endregion DAL.BaseFile.MakeBox.AddWorkTicketInfo(dtInfo); } catch (Exception ex) { } }