示例#1
0
        public bool CheckResultSubmit(OQCCheckModel Model, out string returnMsg)
        {
            try
            {
                using (SqlConnection conn = DBClass.getSqlConnection())
                {
                    conn.Open();
                    using (SqlCommand cmd = conn.CreateCommand())
                    {
                        cmd.CommandType    = CommandType.StoredProcedure;
                        cmd.CommandTimeout = 120;
                        cmd.CommandText    = "P_OQCCheckResult_Submit";
                        cmd.Parameters.AddWithValue("@OQCCheckId", Model.OQCCheckId);
                        cmd.Parameters.AddWithValue("@Describe", Model.Describe);
                        cmd.Parameters.AddWithValue("@QCResult", Model.QCResult);
                        cmd.Parameters.AddWithValue("@XMLData", Model.XMLData);
                        cmd.Parameters.AddWithValue("@ResourceId", System.Configuration.ConfigurationManager.AppSettings["DefaultResourceId"]);

                        cmd.Parameters.Add("@Result_Msg", SqlDbType.NVarChar, 300).Direction = ParameterDirection.Output;
                        cmd.Parameters.Add("@Return", SqlDbType.NVarChar, 300).Direction     = ParameterDirection.Output;
                        cmd.ExecuteNonQuery();
                        int ret_Value = Convert.ToInt32(cmd.Parameters["@Return"].Value);
                        returnMsg = (cmd.Parameters["@Result_Msg"].Value).ToString();
                        cmd.Parameters.Clear();
                        conn.Close();
                        if (ret_Value >= 0)
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
            }
            catch (Exception EX)
            {
                throw;
            }
        }
示例#2
0
        /// <summary>
        /// 保存临时数据
        /// </summary>
        /// <param name="OQCCheckId"></param>
        /// <returns></returns>
        private string checkResultTempSubmit(string OQCCheckId)
        {
            OQCCheckHelper ipqc    = new OQCCheckHelper();
            string         XMLData = CommHelper.ConvertXmlToString(Convert.ToString(Request.Form["OQCData"])).ToString();
            OQCCheckModel  model   = new OQCCheckModel();

            model.Describe   = Describe;
            model.OQCCheckId = OQCCheckId;
            model.XMLData    = XMLData;

            string msg = "";

            if (ipqc.SaveTempData(model, out msg))
            {
                return("{\"result\":1,\"msg\":\"" + msg + "\"}");
            }
            else
            {
                return("{\"result\":-1,\"msg\":\"保存数据失败:" + msg + "\"}");
            }
        }
示例#3
0
        public bool SaveTempData(OQCCheckModel Model, out string returnMsg)
        {
            try
            {
                using (SqlConnection conn = DBClass.getSqlConnection())
                {
                    conn.Open();
                    using (SqlCommand cmd = conn.CreateCommand())
                    {
                        cmd.CommandType    = CommandType.StoredProcedure;
                        cmd.CommandTimeout = 120;
                        cmd.CommandText    = "P_OQCCheckResult_TempSave";
                        cmd.Parameters.AddWithValue("@OQCCheckId", Model.OQCCheckId);
                        cmd.Parameters.AddWithValue("@Describe", Model.Describe);
                        cmd.Parameters.AddWithValue("@XMLData", Model.XMLData);

                        cmd.Parameters.Add("@Result_Msg", SqlDbType.NVarChar, 300).Direction = ParameterDirection.Output;
                        cmd.Parameters.Add("@Return", SqlDbType.NVarChar, 300).Direction     = ParameterDirection.Output;
                        cmd.ExecuteNonQuery();
                        int ret_Value = Convert.ToInt32(cmd.Parameters["@Return"].Value);
                        returnMsg = (cmd.Parameters["@Result_Msg"].Value).ToString();
                        cmd.Parameters.Clear();
                        conn.Close();
                        if (ret_Value >= 0)
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
            }
            catch
            {
                throw;
            }
        }
示例#4
0
        /// <summary>
        /// 提交数据
        /// </summary>
        /// <param name="OQCCheckId"></param>
        /// <returns></returns>
        private string checkResultSubmit(string OQCCheckId)
        {
            OQCCheckHelper ipqc     = new OQCCheckHelper();
            string         XMLData  = CommHelper.ConvertXmlToString(Convert.ToString(Request.Form["OQCData"])).ToString();
            string         Describe = Convert.ToString(Request.Form["Describe"]);
            string         QCResult = Convert.ToString(Request.Form["QCResult"]);
            OQCCheckModel  model    = new OQCCheckModel();

            model.Describe   = Describe;
            model.QCResult   = int.Parse(QCResult);
            model.OQCCheckId = OQCCheckId;
            model.XMLData    = XMLData;
            string msg = "";

            if (ipqc.CheckResultSubmit(model, out msg))
            {
                return("{\"result\":0,\"msg\":\"" + msg + "\"}");
            }
            else
            {
                return("{\"result\":-1,\"msg\":\"数据提交失败:" + msg + "\"}");
            }
        }