Ejemplo n.º 1
0
        /// 填写结果日志
        /// </summary>
        /// <param name="dtResultSrc">页面载入时取得的结果数据DataTable</param>
        /// <param name="strResultIDs">发送的结果id串,多个id用半角逗号分隔</param>
        /// <param name="strSampleIDs">发送的样品id串,多个id用半角逗号分隔</param>
        /// <param name="strCurrentUserId">当前用户ID</param>
        /// <param name="strCurrResultStatus">20</param>
        /// <param name="bIsSampleID">true,根据样品id串处理;false,根据结果id串处理</param>
        /// <returns></returns>
        public bool WriteResultLog(DataTable dtResultSrc, string strResultIDs, string strSampleIDs, string strCurrentUserId, string strCurrResultStatus, bool bIsSampleID)
        {
            if (bIsSampleID)
            {
                strSampleIDs = "'" + strSampleIDs.Replace(",", "','") + "'";

                strResultIDs = "";
                DataTable dtResult_WithSample = access.SelectResult_WithSampleIDs(strSampleIDs, strCurrentUserId, strCurrResultStatus);
                for (int i = 0; i < dtResult_WithSample.Rows.Count; i++)
                {
                    strResultIDs += (strResultIDs.Length > 0 ? "," : "") + dtResult_WithSample.Rows[i]["ID"].ToString();
                }
            }
            strResultIDs = "'" + strResultIDs.Replace(",", "','") + "'";

            DataTable dtResultTar = access.SelectResult_WithIDs(strResultIDs);
            DataTable dtResultApp = access.SelectResultApp_WithIDs(strResultIDs);

            string strLogs = "";

            for (int i = 0; i < dtResultTar.Rows.Count; i++)
            {
                for (int j = 0; j < dtResultSrc.Rows.Count; j++)
                {
                    if (dtResultSrc.Rows[j]["ID"].ToString() == dtResultTar.Rows[i]["ID"].ToString())
                    {
                        if (dtResultSrc.Rows[j]["ITEM_RESULT"].ToString() != dtResultTar.Rows[i]["ITEM_RESULT"].ToString())
                        {
                            DataRow[] drs    = dtResultApp.Select(string.Format("RESULT_ID='{0}'", dtResultSrc.Rows[j]["ID"].ToString()));
                            string    strLog = dtResultSrc.Rows[j]["ID"].ToString() + "|";
                            strLog += dtResultSrc.Rows[j]["ITEM_RESULT"].ToString() + "|";
                            strLog += dtResultSrc.Rows[j]["REMARK_2"].ToString() + "|";
                            strLog += dtResultTar.Rows[i]["ITEM_RESULT"].ToString() + "|";
                            strLog += dtResultTar.Rows[i]["REMARK_2"].ToString() + "|";//原始单号
                            strLog += drs[0]["HEAD_USERID"].ToString() + "|";
                            strLog += drs[0]["ASSISTANT_USERID"].ToString() + "|";
                            strLog += System.DateTime.Now.ToShortDateString();

                            strLogs += (strLogs.Length > 0 ? "@" : "") + strLog;
                        }
                    }
                }
            }
            if (strLogs.Length > 0)
            {
                string[] arrLog     = strLogs.Split('@');
                string   strSerials = new TSysSerialLogic().GetSerialNumberList("MONITOR_RESULT_LOG", strLogs.Length);
                string[] arrSerial  = strSerials.Split(',');
                for (int i = 0; i < arrLog.Length; i++)
                {
                    arrLog[i] = arrSerial[i] + "|" + arrLog[i];
                }

                return(access.InsertResultLog(arrLog));
            }
            else
            {
                return(true);
            }
        }
Ejemplo n.º 2
0
    /// <summary>
    /// 删除序列号,GridView自带操作
    /// </summary>
    protected void grdList_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        TSysSerialVo voSerial = new TSysSerialVo();

        voSerial = new TSysSerialLogic().Details(grdList.DataKeys[e.RowIndex].Value.ToString());
        //删除指定的记录
        if (new TSysSerialLogic().Delete(grdList.DataKeys[e.RowIndex].Value.ToString()))
        {
            base.WriteLog(i3.ValueObject.ObjectBase.LogType.DelSerial, voSerial.ID, LogInfo.UserInfo.USER_NAME + "删除序列号" + voSerial.SERIAL_CODE + "成功!");
        }
        //重新加载数据
        InitSerialListData();
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 删除序列号事件,checkbox选择 By Castle (胡方扬) 2012-10-26
    /// </summary>
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        string[] ids = this.txtHidden.Value.Trim().Split(',');
        foreach (string id in ids)
        {
            TSysSerialVo voSerial = new TSysSerialVo();
            voSerial = new TSysSerialLogic().Details(id);
            //删除指定的记录
            if (new TSysSerialLogic().Delete(id))
            {
                base.WriteLog(i3.ValueObject.ObjectBase.LogType.DelSerial, voSerial.ID, LogInfo.UserInfo.USER_NAME + "删除序列号" + voSerial.SERIAL_CODE + "成功!");
            }

            //InitSerialListData();
        }
        //重新加载数据
        InitSerialListData();
    }