Beispiel #1
0
        /// <summary>
        /// 上传测酒记录
        /// </summary>
        public InterfaceOutPut AddDrinkInfo(String Data)
        {
            InterfaceOutPut output = new InterfaceOutPut();

            output.result = 1;
            try
            {
                InAddDrinkInfo InParams = JsonConvert.DeserializeObject <InAddDrinkInfo>(Data);
                DBLCDrink      db       = new DBLCDrink();

                //职位信息----- 开始----------
                DrinkLogic.DBDrinkLogic dbdl = new DrinkLogic.DBDrinkLogic();
                DrinkLogic.MDDrinkLogic mddl = new DrinkLogic.MDDrinkLogic();
                mddl = dbdl.GetDrinkCadreEntity(InParams.drinkInfo.strTrainmanNumber);
                if (mddl != null)
                {
                    InParams.drinkInfo.strDepartmentID   = mddl.strDepartmentID;
                    InParams.drinkInfo.strDepartmentName = mddl.strDepartmentName;
                    InParams.drinkInfo.nCadreTypeID      = mddl.nCadreTypeID;
                    InParams.drinkInfo.strCadreTypeName  = mddl.strCadreTypeName;
                }
                else
                {
                    InParams.drinkInfo.strDepartmentID   = "";
                    InParams.drinkInfo.strDepartmentName = "";
                    InParams.drinkInfo.nCadreTypeID      = "";
                    InParams.drinkInfo.strCadreTypeName  = "";
                }
                string DrinkGUID = "";
                //职位信息----- 结束----------
                if (!db.ExistDrinkInfo(InParams.drinkInfo.strTrainmanGUID, InParams.drinkInfo.dtCreateTime.Value, out DrinkGUID))
                {
                    db.AddDrinkInfo(InParams.drinkInfo);
                }
                output.result = 0;
            }
            catch (Exception ex)
            {
                output.resultStr = ex.Message;
                throw ex;
            }
            return(output);
        }
Beispiel #2
0
        public void AddDrinkInfo(LCBeginworkFlow.InSubmit InParams)
        {
            //添加测酒记录
            string strSql = @"insert into TAB_Drink_Information  
                   ( strGUID,strTrainmanGUID,strTrainmanNumber,strTrainmanName ,dwAlcoholicity ,nDrinkResult,dtCreateTime , 
                   strTrainNo , strTrainNumber , strTrainTypeName , strPlaceID , strPlaceName, strSiteGUID , strSiteName , 
                   strWorkShopGUID , strWorkShopName ,strAreaGUID,strDutyNumber,strDutyName,nVerifyID,nWorkTypeID,strImagePath,strSiteNumber,bLocalAreaTrainman,strDepartmentID,strDepartmentName,nCadreTypeID,strCadreTypeName) 
                  values (@strGUID,@strTrainmanGUID,@strTrainmanNumber,@strTrainmanName,@dwAlcoholicity,@nDrinkResult,@dtCreateTime,
                   @strTrainNo , @strTrainNumber , @strTrainTypeName , @strPlaceID , @strPlaceName, @strSiteGUID , @strSiteName , 
                   @strWorkShopGUID , @strWorkShopName ,@strAreaGUID,@strDutyNumber,@strDutyName,@nVerifyID,@nWorkTypeID,@strImagePath,@strSiteNumber,@bLocalAreaTrainman,@strDepartmentID,@strDepartmentName,@nCadreTypeID,@strCadreTypeName)";

            int bLocalAreaTrainman;

            if (InParams.DrinkInfo.bLocalAreaTrainman)
            {
                bLocalAreaTrainman = 1;
            }
            else
            {
                bLocalAreaTrainman = 0;
            }

            //职位信息----- 开始----------
            DrinkLogic.DBDrinkLogic dbdl = new DrinkLogic.DBDrinkLogic();
            DrinkLogic.MDDrinkLogic mddl = new DrinkLogic.MDDrinkLogic();
            mddl = dbdl.GetDrinkCadreEntity(InParams.DrinkInfo.strTrainmanNumber);
            if (mddl != null)
            {
                InParams.DrinkInfo.strDepartmentID   = mddl.strDepartmentID;
                InParams.DrinkInfo.strDepartmentName = mddl.strDepartmentName;
                InParams.DrinkInfo.nCadreTypeID      = mddl.nCadreTypeID;
                InParams.DrinkInfo.strCadreTypeName  = mddl.strCadreTypeName;
            }
            else
            {
                InParams.DrinkInfo.strDepartmentID   = "";
                InParams.DrinkInfo.strDepartmentName = "";
                InParams.DrinkInfo.nCadreTypeID      = "";
                InParams.DrinkInfo.strCadreTypeName  = "";
            }
            //职位信息----- 结束----------


            SqlParameter[] sqlParamsDrink = new SqlParameter[] {
                new SqlParameter("strGUID", Guid.NewGuid().ToString()),
                new SqlParameter("strTrainmanGUID", InParams.TrainmanGUID),
                new SqlParameter("strTrainmanNumber", InParams.DrinkInfo.strTrainmanNumber),
                new SqlParameter("strTrainmanName", InParams.DrinkInfo.strTrainmanName),
                new SqlParameter("dwAlcoholicity", InParams.DrinkInfo.dwAlcoholicity),
                new SqlParameter("strTrainNo", InParams.DrinkInfo.strTrainNo),
                new SqlParameter("strTrainNumber", InParams.DrinkInfo.strTrainNumber),
                new SqlParameter("strTrainTypeName", InParams.DrinkInfo.strTrainTypeName),
                new SqlParameter("strPlaceID", InParams.DrinkInfo.strPlaceID),
                new SqlParameter("strPlaceName", InParams.DrinkInfo.strPlaceName),
                new SqlParameter("strSiteGUID", InParams.DrinkInfo.strSiteGUID),
                new SqlParameter("strSiteName", InParams.DrinkInfo.strSiteName),
                new SqlParameter("strWorkShopGUID", InParams.DrinkInfo.strWorkShopGUID),
                new SqlParameter("strWorkShopName", InParams.DrinkInfo.strWorkShopName),
                new SqlParameter("nDrinkResult", InParams.DrinkInfo.drinkResult),
                new SqlParameter("strImagePath", InParams.DrinkInfo.imagePath),
                new SqlParameter("dtCreateTime", InParams.DrinkInfo.createTime),
                new SqlParameter("strAreaGUID", InParams.DrinkInfo.strAreaGUID),
                new SqlParameter("strDutyNumber", ""),
                new SqlParameter("strDutyName", ""),
                new SqlParameter("nVerifyID", InParams.VerifyID),
                new SqlParameter("nWorkTypeID", 2),
                new SqlParameter("strSiteNumber", ""),
                new SqlParameter("bLocalAreaTrainman", bLocalAreaTrainman),
                new SqlParameter("strDepartmentID", InParams.DrinkInfo.strDepartmentID),
                new SqlParameter("strDepartmentName", InParams.DrinkInfo.strDepartmentName),
                new SqlParameter("nCadreTypeID", InParams.DrinkInfo.nCadreTypeID),
                new SqlParameter("strCadreTypeName", InParams.DrinkInfo.strCadreTypeName)
            };
            SqlHelper.ExecuteNonQuery(SqlHelper.ConnString, CommandType.Text, strSql, sqlParamsDrink);
            string    strTrainmanNumber = "";
            string    strTrainmanName   = "";
            DataTable dt = GetTrainman(InParams.TrainmanGUID);

            if (dt.Rows.Count > 0)
            {
                strTrainmanNumber = ObjectConvertClass.static_ext_string(dt.Rows[0]["strTrainmanNumber"]);
                strTrainmanName   = ObjectConvertClass.static_ext_string(dt.Rows[0]["strTrainmanName"]);
            }

            SaveDrinkStepData(InParams.TrainPlanGUID, InParams.TrainmanGUID, strTrainmanNumber, strTrainmanName, InParams);
        }
Beispiel #3
0
        public void AddDrinkInfo(InSubmitDrink InParams, int nWorkTypeID, string strStepName = "RS.STEP.DRINKTEST")
        {
            //为了和之前的程序进行兼容,继续向老的数据库中增加数据,按照原有老的方式
            string chuqinID         = "";
            int    nDrinkWorkTypeID = 0;

            if (nWorkTypeID == 1)
            {
                this.SubBeginWorkForOld(InParams.TrainPlanGUID, InParams.TrainmanGUID, InParams.DrinkInfo.createTime, InParams.VerifyID, InParams.Remark, InParams, ref chuqinID);
                nDrinkWorkTypeID = 2;//将测酒类型变成出勤测酒
            }
            else if (nWorkTypeID == 2)
            {
                this.SubEndWorkForOld(InParams.TrainPlanGUID, InParams.TrainmanGUID, InParams.DrinkInfo.createTime, InParams.VerifyID, InParams.Remark, ref chuqinID);
                nDrinkWorkTypeID = 3;//将测酒类型变成退勤测酒
            }

            //添加测酒记录
            string strSql = @"insert into TAB_Drink_Information  
                   ( strGUID,strTrainmanGUID,strTrainmanNumber,strTrainmanName ,dwAlcoholicity ,nDrinkResult,dtCreateTime , 
                   strTrainNo , strTrainNumber , strTrainTypeName , strPlaceID , strPlaceName, strSiteGUID , strSiteName , 
                   strWorkShopGUID , strWorkShopName ,strAreaGUID,strDutyNumber,strDutyName,nVerifyID,nWorkTypeID,strWorkID,strImagePath,strSiteNumber,bLocalAreaTrainman,strDepartmentID,strDepartmentName,nCadreTypeID,strCadreTypeName) 
                  values (@strGUID,@strTrainmanGUID,@strTrainmanNumber,@strTrainmanName,@dwAlcoholicity,@nDrinkResult,@dtCreateTime,
                   @strTrainNo , @strTrainNumber , @strTrainTypeName , @strPlaceID , @strPlaceName, @strSiteGUID , @strSiteName , 
                   @strWorkShopGUID , @strWorkShopName ,@strAreaGUID,@strDutyNumber,@strDutyName,@nVerifyID,@nWorkTypeID,@strWorkID,@strImagePath,@strSiteNumber,@bLocalAreaTrainman,@strDepartmentID,@strDepartmentName,@nCadreTypeID,@strCadreTypeName)";

            int bLocalAreaTrainman;

            if (InParams.DrinkInfo.bLocalAreaTrainman)
            {
                bLocalAreaTrainman = 1;
            }
            else
            {
                bLocalAreaTrainman = 0;
            }
            //职位信息----- 开始----------
            DrinkLogic.DBDrinkLogic dbdl = new DrinkLogic.DBDrinkLogic();
            DrinkLogic.MDDrinkLogic mddl = new DrinkLogic.MDDrinkLogic();
            mddl = dbdl.GetDrinkCadreEntity(InParams.DrinkInfo.strTrainmanNumber);
            if (mddl != null)
            {
                InParams.DrinkInfo.strDepartmentID   = mddl.strDepartmentID;
                InParams.DrinkInfo.strDepartmentName = mddl.strDepartmentName;
                InParams.DrinkInfo.nCadreTypeID      = mddl.nCadreTypeID;
                InParams.DrinkInfo.strCadreTypeName  = mddl.strCadreTypeName;
            }
            else
            {
                InParams.DrinkInfo.strDepartmentID   = "";
                InParams.DrinkInfo.strDepartmentName = "";
                InParams.DrinkInfo.nCadreTypeID      = "";
                InParams.DrinkInfo.strCadreTypeName  = "";
            }
            //职位信息----- 结束----------


            SqlParameter[] sqlParamsDrink = new SqlParameter[] {
                new SqlParameter("strGUID", Guid.NewGuid().ToString()),
                new SqlParameter("strTrainmanGUID", InParams.TrainmanGUID),
                new SqlParameter("strTrainmanNumber", InParams.DrinkInfo.strTrainmanNumber),
                new SqlParameter("strTrainmanName", InParams.DrinkInfo.strTrainmanName),
                new SqlParameter("dwAlcoholicity", InParams.DrinkInfo.dwAlcoholicity),
                new SqlParameter("strTrainNo", InParams.DrinkInfo.strTrainNo),
                new SqlParameter("strTrainNumber", InParams.DrinkInfo.strTrainNumber),
                new SqlParameter("strTrainTypeName", InParams.DrinkInfo.strTrainTypeName),
                new SqlParameter("strPlaceID", InParams.DrinkInfo.strPlaceID),
                new SqlParameter("strPlaceName", InParams.DrinkInfo.strPlaceName),
                new SqlParameter("strSiteGUID", InParams.DrinkInfo.strSiteGUID),
                new SqlParameter("strSiteName", InParams.DrinkInfo.strSiteName),
                new SqlParameter("strWorkShopGUID", InParams.DrinkInfo.strWorkShopGUID),
                new SqlParameter("strWorkShopName", InParams.DrinkInfo.strWorkShopName),
                new SqlParameter("nDrinkResult", InParams.DrinkInfo.drinkResult),
                new SqlParameter("strImagePath", InParams.DrinkInfo.imagePath),
                new SqlParameter("dtCreateTime", InParams.DrinkInfo.createTime),
                new SqlParameter("strAreaGUID", InParams.DrinkInfo.strAreaGUID),
                new SqlParameter("strDutyNumber", ""),
                new SqlParameter("strDutyName", ""),
                new SqlParameter("nVerifyID", InParams.VerifyID),
                new SqlParameter("nWorkTypeID", nDrinkWorkTypeID),
                new SqlParameter("strWorkID", chuqinID),
                new SqlParameter("strSiteNumber", ""),
                new SqlParameter("bLocalAreaTrainman", bLocalAreaTrainman),
                new SqlParameter("strDepartmentID", InParams.DrinkInfo.strDepartmentID),
                new SqlParameter("strDepartmentName", InParams.DrinkInfo.strDepartmentName),
                new SqlParameter("nCadreTypeID", InParams.DrinkInfo.nCadreTypeID),
                new SqlParameter("strCadreTypeName", InParams.DrinkInfo.strCadreTypeName)
            };
            SqlHelper.ExecuteNonQuery(SqlHelper.ConnString, CommandType.Text, strSql, sqlParamsDrink);
            string    strTrainmanNumber = "";
            string    strTrainmanName   = "";
            DataTable dt = GetTrainman(InParams.TrainmanGUID);

            if (dt.Rows.Count > 0)
            {
                strTrainmanNumber = ObjectConvertClass.static_ext_string(dt.Rows[0]["strTrainmanNumber"]);
                strTrainmanName   = ObjectConvertClass.static_ext_string(dt.Rows[0]["strTrainmanName"]);
            }

            SaveDrinkStepData(InParams.TrainPlanGUID, InParams.TrainmanGUID, strTrainmanNumber, strTrainmanName, InParams, nWorkTypeID, strStepName);
        }