Esempio n. 1
0
        /// <summary>
        /// 关联已有测酒记录(退勤)
        /// </summary>
        public InterfaceOutPut UnionTuiQin(String Data)
        {
            InterfaceOutPut output = new InterfaceOutPut();

            output.result = 1;
            try
            {
                JavaScriptSerializer javaScriptSerializer = new JavaScriptSerializer();
                InUnionTuiQin        InParams             = javaScriptSerializer.Deserialize <InUnionTuiQin>(Data);
                DB_Plan_EndWork      dbPlanEndWork        = new DB_Plan_EndWork();
                dbPlanEndWork.UnionTuiQin(InParams);
                output.result = 0;
            }
            catch (Exception ex)
            {
                output.resultStr = ex.Message;
                LogClass.log("Interface.Union:" + ex.Message);
                throw ex;
            }
            return(output);
        }
Esempio n. 2
0
        public JsonModel ExecuteEndWork(string input)
        {
            JsonModel jsonModel = new JsonModel();

            jsonModel.result    = 1;
            jsonModel.resultStr = "数据提交失败:未找到指定的机组信息";
            TF.Api.Utilities.Validation validater = new TF.Api.Utilities.Validation();
            try
            {
                InputParam paramModel = Newtonsoft.Json.JsonConvert.DeserializeObject <InputParam>(input);

                DB_Plan_EndWork rcEndWork    = new DB_Plan_EndWork();
                DateTime        ArrvieTime   = DateTime.Now;
                bool            isArrvieTime = getGetLastArrvieTime(paramModel.planID, ref ArrvieTime);

                if (isArrvieTime)
                {
                    ArrvieTime = Convert.ToDateTime("1899-01-01");
                }

                if (rcEndWork.Endwork(paramModel.drinkdata, paramModel.dutyUser, paramModel.planID, paramModel.siteID, paramModel.VerifyID, paramModel.remark, ArrvieTime))
                {
                    jsonModel.result    = 0;
                    jsonModel.resultStr = "提交成功";
                }
                else
                {
                    jsonModel.result = 1;
                }
            }
            catch (Exception ex)
            {
                TF.CommonUtility.LogClass.logex(ex, "");
                jsonModel.result    = 1;
                jsonModel.resultStr = "提交失败" + ex.Message;
            }
            return(jsonModel);
        }