public static void updateRowCss(string ridx, FineUIPro.Grid grid, string cssname) { grid.Rows[int.Parse(ridx)].RowCssClass = cssname; }
public static string NewPLsendInstruction(string OrderNo, string ProNo, string ProName, string ReceiveDept, string Receiver, string OdtSN, string userid, FineUIPro.Grid grid) { StringBuilder sql = new StringBuilder(); ArrayList al = new ArrayList(); string s = ""; SQLHelper.DbHelperSQL.SetConnectionString(""); foreach (int i in grid.SelectedRowIndexArray) { s = "select count(*) from Instruction where OrderNo='" + OrderNo + "' and OdtSN=" + OdtSN + " and itemno='" + grid.Rows[i].Values[2].ToString() + "' and IsConfirm=0"; if (int.Parse(SQLHelper.DbHelperSQL.GetSingle(s, 30)) > 0) { continue; } s = "select (case when sum(ConfirmQuantity) is null then 0 else sum(ConfirmQuantity) end) from instruction where orderno='" + OrderNo + "' and OdtSN=" + OdtSN + " and itemno='" + grid.Rows[i].Values[2].ToString() + "'"; sql.Clear(); sql.Append("insert into Instruction(OrderNo,ProNo,ProName,ItemNo,ItemName,Spec,Material,SurfaceDeal,UsingQuantity,Sclass,MainFrom,Inputer,InputeDate,IsConfirm,IsPlan,ReceiveDept,Receiver,BarCode,BomSN,OdtSN,ConfirmQuantity,RealUsingQuantity,ConfirmDate)"); sql.Append(" values("); sql.Append("'" + OrderNo + "',"); sql.Append("'" + ProNo + "',"); sql.Append("'" + ProName + "',"); sql.Append("'" + grid.Rows[i].Values[2].ToString() + "',"); //ItemNo sql.Append("'" + grid.Rows[i].Values[3].ToString() + "',"); //ItemName sql.Append("'" + grid.Rows[i].Values[4].ToString() + "',"); //Spec sql.Append("'" + grid.Rows[i].Values[5].ToString() + "',"); //Material sql.Append("'" + grid.Rows[i].Values[6].ToString() + "',"); //SurfaceDeal sql.Append("" + grid.Rows[i].Values[8].ToString() + ","); //UsingQuantity sql.Append("'" + grid.Rows[i].Values[9].ToString() + "',"); //Sclass sql.Append("'" + grid.Rows[i].Values[12].ToString() + "',"); //MainFrom sql.Append("'" + userid + "',"); sql.Append("getdate(),"); sql.Append("1,"); //IsConfirm sql.Append("0,"); //IsPlan sql.Append("'" + ReceiveDept + "',"); sql.Append("'" + Receiver + "',"); System.Threading.Thread.Sleep(1); sql.Append("'" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "',"); sql.Append(grid.DataKeys[i][0] + ","); sql.Append(OdtSN + ","); sql.Append("0,"); //ConfirmQuantity sql.Append("" + grid.Rows[i].Values[8].ToString() + ","); //RealUsingQuantity sql.Append("getdate()"); //ConfirmDate sql.Append(")"); al.Add(sql.ToString()); //FileOper.writeLog(sql.ToString()); FileOper.writeLog(sql.ToString()); } if (SQLHelper.DbHelperSQL.ExecuteSqlTran(al)) { return("发送成功"); } else { return("发送失败"); } }