Beispiel #1
0
        /// <summary>
        /// 根据AQL参数获取样本和允收标准
        /// </summary>
        /// <param name="SQCID"></param>
        /// <param name="cyfs"></param>
        /// <param name="jcsp"></param>
        /// <param name="jybz"></param>
        private void selectAQL_Info(string SQCID, string cyfs, string jcsp, string jybz)
        {
            SendQCReport sqcr = new SendQCReport();
            DataTable    dt   = sqcr.selectAQLInfo(SQCID, cyfs, jcsp, jybz);

            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                string  result, RetMsg = "";
                result = dr["RetValue"].ToString();
                RetMsg = dr["RetMsg"].ToString();
                if (result == "0")
                {
                    //AQLSampleSizeQty,@ACQty AS ACQty,@ReQty AS ReQty
                    StringBuilder sb = new StringBuilder();
                    sb.Append("{\"result\":0,\"msg\":\"获取成功\",\"data\":[");
                    string json = "{" + String.Format("\"SampleQty\":\"{0}\" ,\"ACQty\":\"{1}\",\"ReQty\":\"{2}\"",
                                                      dr["AQLSampleSizeQty"].ToString(), Convert.ToInt32(dr["ACQty"]).ToString(), dr["ReQty"]) + "}]}";
                    sb.Append(json);
                    Response.Write(sb.ToString());
                    string str = sb.ToString();
                    return;
                }
                else
                {
                    Response.Write("{\"result\":1,\"msg\":\"" + RetMsg + "\"}");
                }
            }
            else
            {
                Response.Write("{\"result\":-1,\"msg\":\"获取AQL信息失败\"}");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            int          pageCount, recCount;
            SendQCReport SQ = new SendQCReport();

            result.RetStr = SQ.getSendQCReportList("", "", 20, curPage, out pageCount, out recCount, out outDataSet);
            if (result.Code == 0)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("{\"result\":0,\"msg\":\"获取成功\",\"data\":[");
                for (int i = 0; i < outDataSet.Tables[0].Rows.Count; i++)
                {
                    DataRow dr      = outDataSet.Tables[0].Rows[i];
                    int     SendQty = Convert.IsDBNull(dr["SendQCQty"]) ? 0 : Convert.ToInt32(dr["SendQCQty"]);
                    string  json    = "{" + String.Format("\"SendQCReportId\":\"{0}\",\"SendQCReportNumber\":\"{1}\",\"VendorName\":\"{2}\","

                                                          + "\"ProductShortName\":\"{3}\",\"ProductDescription\":\"{4}\",\"SendQCQty\":\"{5}\",\"SendDate\":\"{6}\",\"QCResult\":\"{7}\",\"POName\":\"{8}\"",
                                                          dr["SendQCReportId"], dr["SendQCReportNumber"], dr["VendorName"], dr["ProductShortName"],
                                                          dr["ProductDescription"], SendQty.ToString(), dr["SendDate"], dr["QCResult"], dr["POName"]) + "}";
                    sb.Append(json);
                    if (i != outDataSet.Tables[0].Rows.Count - 1)
                    {
                        sb.Append(",");
                    }
                }
                sb.Append("]}");
                string str = sb.ToString();
                Response.Write(sb.ToString());
            }
            else
            {
                Response.Write("{\"result\":1,\"msg\":\"获取失败\"}");
            }
        }
Beispiel #3
0
        /// <summary>
        /// 生产并打印物料标签
        /// </summary>
        /// <param name="SQCId"></param>
        private void PrintSQCLabels(string SQCId, string CYFS, string JCSP, string JYBZ)
        {
            SendQCReport sqcr = new SendQCReport();
            string       msg  = "";

            if (sqcr.PrintSQCLabel(SQCId, CYFS, JCSP, JYBZ, out msg))
            {
                Response.Write("{\"result\":1,\"msg\":\"" + msg + "\"}");
            }
            else
            {
                Response.Write("{\"result\":-1,\"msg\":\"打印样本标签失败:" + msg + "\"}");
            }
        }
Beispiel #4
0
        /// <summary>
        /// 删除扫描记录
        /// </summary>
        /// <param name="SQCId"></param>
        private void DelScanList(string SQCId, string LotSN)
        {
            SendQCReport sqcr = new SendQCReport();
            string       msg  = "";

            if (sqcr.delScanList(SQCId, LotSN, out msg))
            {
                Response.Write("{\"result\":1,\"msg\":\"" + msg + "\"}");
            }
            else
            {
                Response.Write("{\"result\":-1,\"msg\":\"抽样记录删除失败:" + msg + "\"}");
            }
        }
Beispiel #5
0
        /// <summary>
        /// 样本抽取数据提交
        /// </summary>
        /// <param name="SQCId">送检单Id</param>
        /// <param name="CYFS">抽样方式</param>
        /// <param name="JCSP">检查水平</param>
        /// <param name="JYBZ">检验标准</param>
        /// <param name="ScanSN">扫描SN</param>
        /// <param name="CQ_Qty">抽取数量</param>
        private void ScanSubmit(string SQCId, string CYFS, string JCSP, string JYBZ, string ScanSN, string CQ_Qty)
        {
            SendQCReport sqcr = new SendQCReport();
            string       msg  = "";

            if (sqcr.SPec_ScanSubmit(SQCId, CYFS, JCSP, JYBZ, ScanSN, CQ_Qty, out msg))
            {
                Response.Write("{\"result\":1,\"msg\":\"样本抽取成功:" + msg + "\"}");
            }
            else
            {
                Response.Write("{\"result\":-1,\"msg\":\"样本抽取失败:" + msg + "\"}");
            }
        }
Beispiel #6
0
        /// <summary>
        /// 获取样本扫描列表
        /// </summary>
        /// <param name="SQCId">送检Id</param>
        private void LoadScanList(string SQCId = "SQCR000000TK")
        {
            try
            {
                SendQCReport sqcr   = new SendQCReport();
                DataTable    dt     = sqcr.getScanList(SQCId);
                int          T_CQty = 0;
                if (dt.Rows.Count > 0)
                {
                    StringBuilder sb = new StringBuilder();
                    sb.Append("{\"result\":0,\"msg\":\"扫描记录获取成功" + SQCId + "\",\"data\":[");

                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        //LotId,LotSN, CYFS,CYSP,CYBZ ,SpecQty

                        DataRow dr   = dt.Rows[i];
                        string  json = "{" + String.Format("\"LotId\":\"{0}\",\"LotSN\":\"{1}\",\"CYFS\":\"{2}\",\"CYSP\":\"{3}\",\"CYBZ\":\"{4}\",\"SpecQty\":\"{5}\"",
                                                           dr["LotId"], dr["LotSN"], dr["CYFS"], dr["CYSP"], dr["CYBZ"], dr["SpecQty"]) + "}";
                        sb.Append(json);
                        if (i != dt.Rows.Count - 1)
                        {
                            sb.Append(",");
                        }
                        T_CQty += Convert.ToInt32(dr["SpecQty"]);
                        /* */
                    }
                    sb.Append("],\"T_Qty\":\"" + T_CQty.ToString() + "\"");
                    sb.Append("}");
                    Response.Write(sb.ToString());
                }
                else
                {
                    Response.Write("{\"result\":0,\"msg\":\"扫描记录获取成功\"}");
                }
            }
            catch (Exception ex)
            {
                Response.Write("{\"result\":-1,\"msg\":\"" + ex.Message + "\"}");
            }
        }
Beispiel #7
0
        /// <summary>
        /// 抽检 页面加载事件
        /// </summary>
        private void GetSpecPageLoad(string SendQCReportId)
        {
            SendQCReportId = "SQCR000000TL";//测试


            SendQCReport SQCR = new SendQCReport();
            DataTable    dt   = SQCR.SpecPageLoad(SendQCReportId);

            if (dt.Rows.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("{\"result\":0,\"msg\":\"获取成功\",\"data\":[");

                //      SendQCReportId,   POName,  VendorName,  ProductId,ProductShortName
                //ProductDescription,   SendQCQty,   CYFS ,  JYSP ,  JYBZ ,    JY_QTY,   IsCYDone

                DataRow dr = dt.Rows[0];
                if (Convert.ToInt32(dr["RetValue"]) == 0)
                {
                    string json = "{" + String.Format("\"SendQCReportId\":\"{0}\" ,\"POName\":\"{1}\"," +
                                                      "\"VendorName\":\"{2}\",\"ProductId\":\"{3}\",\"ProductDescription\":\"{4}\"," +
                                                      "\"SendQCQty\":\"{5}\",\"CYFS\":\"{6}\",\"JYSP\":\"{7}\",\"JYBZ\":\"{8}\",\"JY_QTY\":\"{9}\",\"IsCYDone\":\"{10}\",\"ProductShortName\":\"{11}\",\"TCQ_Qty\":\"{12}\"",
                                                      dr["SendQCReportId"], dr["POName"], dr["VendorName"], dr["ProductId"], dr["ProductDescription"], dr["SendQCQty"], dr["CYFS"]
                                                      , dr["JYSP"], dr["JYBZ"], dr["JY_QTY"], dr["IsCYDone"], dr["ProductShortName"], dr["TCQ_Qty"]) + "}";
                    sb.Append(json);
                    sb.Append("]}");
                    string str = sb.ToString();
                    Response.Write(sb.ToString());
                }
                else
                {
                    Response.Write("{\"result\":1,\"" + dr["RetMsg"].ToString() + "\":\"获取失败\"}");
                }
            }
            else
            {
                Response.Write("{\"result\":-1,\"msg\":\"获取失败\"}");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            SendQCReport SQ = new SendQCReport();

            result.RetStr = SQ.getSendQCReportInfo(SendQCReportId, out outDataSet);
            if (result.Code == 0)
            {
                if (outDataSet.Tables[0].Rows.Count > 0)
                {
                    // studentId.Value = outDataSet.Tables[0].Rows[0]["SendQCReportId"].ToString();
                    //lblName.Text = outDataSet.Tables[0].Rows[0]["name"].ToString();
                    //lblSex.Text = outDataSet.Tables[0].Rows[0]["sex"].ToString();
                    //lblNo.Text = outDataSet.Tables[0].Rows[0]["no"].ToString();
                    //lblPhone.Text = outDataSet.Tables[0].Rows[0]["phone"].ToString();
                    //lblAddress.Text = outDataSet.Tables[0].Rows[0]["address"].ToString();
                    //score.Text = outDataSet.Tables[0].Rows[0]["score"].ToString();
                }
            }
            else
            {
                Response.Write(result.Msg);
            }
        }