Beispiel #1
0
        protected static void getMaterFormalu_SQL(string id, string prodCode)
        {
            MSYS.Web.MateriaService.WsBaseDataInterfaceService service = new MSYS.Web.MateriaService.WsBaseDataInterfaceService();
            MSYS.DAL.DbOperator opt = new MSYS.DAL.DbOperator();
            //   List<string> commandlist = new List<string>();
            materFormulaVO info = service.getMatFormulaById(id);
            string         temp;

            if (info != null)
            {
                string[] seg   = { "ID", "FORMULA_CODE", "FORMULA_NAME", "ADJUST", "B_DATE", "CABO_SUM", "CONTROL_STATUS", "CREATE_DATE", "CREATE_DEPT_ID", "CREATE_ID", "E_DATE", "EXECUTEBATCH", "FLOW_STATUS", "IS_DEL", "IS_VALID", "MODIFY_ID", "MODIFY_TIME", "PIECE_NUM", "PIECES_SUM", "PROD_CODE", "REMARK", "SMALLS_NUM", "STANDARD_VOL", "STEM_NUM", "STICKS_NUM" };
                string[] value = { id,            "703" + info.formulaCode, info.formulaName,         info.adjust,               info.BDate.ToString("yyyy-MM-dd HH:mm:ss"), info.caboSum.ToString(), info.controlStatus,        info.createDate,  info.createDept,         info.createId, info.EDate.ToString("yyyy-MM-dd HH:mm:ss"), info.executeBatch.ToString(), info.flowStatus, info.isDel, info.isValid,
                                   info.modifyId, info.modifyTime,          info.pieceNum.ToString(), info.piecesSum.ToString(), prodCode,                                   info.remark,             info.smallsNum.ToString(), info.standardVol, info.stemNum.ToString(), info.sticksNum.ToString() };
                temp = opt.getMergeStr(seg, value, 2, "HT_QA_MATER_FORMULA");
                //     commandlist.Add(temp);
                if (opt.UpDateOra(temp) != "Success")
                {
                    System.Diagnostics.Debug.Write(temp);
                }


                if (info.ygSubList != null && info.ygSubList.Length > 0)
                {
                    string[] subseg = { "ID", "MATER_CODE", "BATCH_SIZE", "FRONT_GROUP", "IS_DEL", "MATER_FLAG", "FORMULA_CODE", "MATER_SORT", "REMARK" };
                    foreach (tQaMaterFormulaDetail detail in info.ygSubList)
                    {
                        string[] subvalue = { detail.id.ToString(), detail.materCode, detail.batchSize.ToString(), detail.frontGroup, detail.isDel, detail.materFlag, id, detail.materSort.ToString(), detail.remark };
                        temp = opt.getMergeStr(subseg, subvalue, 2, "HT_QA_MATER_FORMULA_DETAIL");
                        //       commandlist.Add(temp);
                        if (opt.UpDateOra(temp) != "Success")
                        {
                            System.Diagnostics.Debug.Write(temp);
                        }
                    }
                }
                if (info.spSubList != null && info.spSubList.Length > 0)
                {
                    string[] subseg = { "ID", "MATER_CODE", "BATCH_SIZE", "FRONT_GROUP", "IS_DEL", "MATER_FLAG", "FORMULA_CODE", "MATER_SORT", "REMARK" };
                    foreach (tQaMaterFormulaDetail detail in info.spSubList)
                    {
                        string[] subvalue = { detail.id.ToString(), detail.materCode, detail.batchSize.ToString(), detail.frontGroup, detail.isDel, detail.materFlag, id, detail.materSort.ToString(), detail.remark };
                        temp = opt.getMergeStr(subseg, subvalue, 2, "HT_QA_MATER_FORMULA_DETAIL");
                        //         commandlist.Add(temp);
                        if (opt.UpDateOra(temp) != "Success")
                        {
                            System.Diagnostics.Debug.Write(temp);
                        }
                    }
                }
            }
        }