예제 #1
0
        /// <summary>
        /// 部分修改保存
        /// </summary>
        /// <param name="model">对象tlsTtResultSecond的一个实例参数</param>
        /// <returns></returns>
        public int UpdatePart(tlsTtResultSecond model, out string errMsg)
        {
            errMsg = string.Empty;
            int rtn = 0;

            try
            {
                sql.Length = 0;
                sql.Append("UPDATE ttResultSecond SET ");
                sql.AppendFormat("ReportDeliTime='{0}',", model.ReportDeliTime);
                sql.AppendFormat("IsReconsider={0},", model.IsReconsider);
                sql.AppendFormat("ReconsiderTime='{0}',", model.ReconsiderTime);
                sql.AppendFormat("ProceResults='{0}',", model.ProceResults);
                sql.AppendFormat("CheckPlaceCode='{0}',", model.CheckPlaceCode);
                sql.AppendFormat("CheckPlace='{0}',", model.CheckPlace);
                sql.AppendFormat("TakeDate='{0}',", model.TakeDate);
                sql.AppendFormat("DateManufacture='{0}',", model.DateManufacture);
                sql.AppendFormat("SamplingPlace='{0}',", model.SamplingPlace);
                sql.AppendFormat("CheckedComDis='{0}',", model.CheckedComDis);
                sql.AppendFormat("CheckType='{0}',", model.CheckType);
                sql.AppendFormat("IsUpload='{0}',", model.IsUpload.Equals("Y") ? "S" : model.IsUpload);
                sql.AppendFormat("CheckValueInfo='{0}',", model.CheckValueInfo);
                sql.AppendFormat("Result='{0}',", model.Result);
                sql.AppendFormat("CheckNo='{0}',", model.CheckNo);
                sql.AppendFormat("CheckPlanCode='{0}',", model.CheckPlanCode);
                sql.AppendFormat("CheckTotalItem='{0}',", model.CheckTotalItem);
                sql.AppendFormat("Standard='{0}',", model.Standard);
                sql.AppendFormat("CheckUnitName='{0}',", model.CheckUnitName);
                sql.AppendFormat("APRACategory='{0}',", model.APRACategory);
                sql.AppendFormat("CheckedCompany='{0}',", model.CheckedCompany);
                sql.AppendFormat("CheckedCompanyCode='{0}',", model.CheckedCompanyCode);
                sql.AppendFormat("CheckStartDate='{0}',", model.CheckStartDate);
                sql.AppendFormat("Organizer='{0}',", model.Organizer);
                sql.AppendFormat("FoodName='{0}',", model.FoodName);
                sql.AppendFormat("SampleCode='{0}',", model.SampleCode);
                sql.AppendFormat("StandValue='{0}',", model.StandValue);
                sql.AppendFormat("ResultInfo='{0}',", model.ResultInfo);
                sql.AppendFormat("ProduceCompany='{0}',", model.ProduceCompany);
                sql.AppendFormat("UpLoader='{0}'", model.UpLoader);
                sql.AppendFormat(" WHERE ID={0}", model.ID);
                DataBase.ExecuteCommand(sql.ToString(), out errMsg);
                sql.Length = 0;
                rtn        = 1;
            }
            catch (Exception e)
            {
                errMsg = e.Message;
            }
            return(rtn);
        }
예제 #2
0
        /// <summary>
        /// 修改展示状态
        /// </summary>
        /// <param name="model"></param>
        /// <param name="errMsg"></param>
        /// <returns></returns>
        public int UpdateShow(tlsTtResultSecond model, out string errMsg)
        {
            errMsg = string.Empty;
            int rtn = 0;

            try
            {
                sql.Length = 0;
                sql.Append("Update ttResultSecond Set ");
                sql.AppendFormat("IsShow='{0}'", model.IsShow);
                sql.AppendFormat(" Where ID={0}", model.ID);
                DataBase.ExecuteCommand(sql.ToString(), out errMsg);
                sql.Length = 0;
                rtn        = 1;
            }
            catch (Exception e)
            {
                errMsg = e.Message;
            }
            return(rtn);
        }
예제 #3
0
        /// <summary>
        /// 插入一条明细记录
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Insert(tlsTtResultSecond model, out string errMsg)
        {
            errMsg = string.Empty;
            int rtn = 0;

            try
            {
                sql.Length = 0;
                sql.Append(" INSERT INTO ttResultSecond ");
                sql.Append(" (ResultType,CheckNo,SampleCode,CheckPlaceCode,CheckPlace,FoodName,FoodType,TakeDate,CheckStartDate,Standard,CheckMachine, ");
                sql.Append(" CheckMachineModel,MachineCompany,CheckTotalItem,CheckValueInfo,StandValue,Result,ResultInfo,CheckUnitName,CheckUnitInfo, ");
                sql.Append(" Organizer,UpLoader,ReportDeliTime,IsReconsider,ReconsiderTime,ProceResults,CheckedCompanyCode,CheckedCompany,CheckedComDis, ");
                sql.Append(" CheckPlanCode,Hole,CheckMethod,APRACategory,CheckType,DateManufacture,ContrastValue,DeviceId,SampleId,ProduceCompany,SysCode,");
                sql.Append(" MarketType,DABH,PositionNo,DABHName,SubItemCode,SubItemName,QuickCheckItemCode,QuickCheckSubItemCode) ");
                sql.Append(" VALUES(");
                sql.AppendFormat("'{0}',", model.ResultType);
                sql.AppendFormat("'{0}',", model.CheckNo);
                sql.AppendFormat("'{0}',", model.SampleCode);
                sql.AppendFormat("'{0}',", model.CheckPlaceCode);
                sql.AppendFormat("'{0}',", model.CheckPlace);
                sql.AppendFormat("'{0}',", model.FoodName);
                sql.AppendFormat("'{0}',", model.FoodType);
                sql.AppendFormat("'{0}',", model.TakeDate);
                sql.AppendFormat("'{0}',", model.CheckStartDate);
                sql.AppendFormat("'{0}',", model.Standard);
                sql.AppendFormat("'{0}',", model.CheckMachine);
                sql.AppendFormat("'{0}',", model.CheckMachineModel);
                sql.AppendFormat("'{0}',", model.MachineCompany);
                sql.AppendFormat("'{0}',", model.CheckTotalItem);
                sql.AppendFormat("'{0}',", model.CheckValueInfo);
                sql.AppendFormat("'{0}',", model.StandValue);
                sql.AppendFormat("'{0}',", model.Result);
                sql.AppendFormat("'{0}',", model.ResultInfo);
                sql.AppendFormat("'{0}',", model.CheckUnitName);
                sql.AppendFormat("'{0}',", model.CheckUnitInfo);
                sql.AppendFormat("'{0}',", model.Organizer);
                sql.AppendFormat("'{0}',", model.UpLoader);
                sql.AppendFormat("'{0}',", model.ReportDeliTime);
                sql.AppendFormat("{0},", model.IsReconsider);
                sql.AppendFormat("'{0}',", model.ReconsiderTime);
                sql.AppendFormat("'{0}',", model.ProceResults);
                sql.AppendFormat("'{0}',", model.CheckedCompanyCode);
                sql.AppendFormat("'{0}',", model.CheckedCompany);
                sql.AppendFormat("'{0}',", model.CheckedComDis);
                sql.AppendFormat("'{0}',", model.CheckPlanCode);
                sql.AppendFormat("'{0}',", model.Hole);
                sql.AppendFormat("'{0}',", model.CheckMethod);
                sql.AppendFormat("'{0}',", model.APRACategory);
                sql.AppendFormat("'{0}',", model.CheckType);
                sql.AppendFormat("'{0}',", model.DateManufacture);
                sql.AppendFormat("'{0}',", model.ContrastValue);
                sql.AppendFormat("'{0}',", model.DeviceId);
                sql.AppendFormat("'{0}',", model.SampleId);
                sql.AppendFormat("'{0}',", model.ProduceCompany);
                sql.AppendFormat("'{0}',", model.SysCode);
                sql.AppendFormat("'{0}',", model.MarketType);
                sql.AppendFormat("'{0}',", model.DABH);
                sql.AppendFormat("'{0}',", model.PositionNo);
                sql.AppendFormat("'{0}',", model.DABHName);
                sql.AppendFormat("'{0}',", model.SubItemCode);
                sql.AppendFormat("'{0}',", model.SubItemName);
                sql.AppendFormat("'{0}',", model.QuickCheckItemCode);
                sql.AppendFormat("'{0}')", model.QuickCheckSubItemCode);
                DataBase.ExecuteCommand(sql.ToString(), out errMsg);
                sql.Length = 0;

                rtn = 1;
            }
            catch (Exception e)
            {
                errMsg = e.Message;
            }
            return(rtn);
        }