Exemplo n.º 1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TQC_FACE_ROLL GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_ROLL_ID,C_STOVE,C_BATCH_NO,C_TICK_NO,C_STL_GRD,N_WGT,C_STD_CODE,C_SPEC,C_MAT_CODE,C_MAT_NAME,C_SHIFT,C_GROUP,C_JUDGE_LEV,C_REASON_NAME,C_REASON_CODE,C_REASON_DEPMT_ID,C_REASON_DEPMT_DESC,C_SUGGESTION,N_STATUS,C_REMARK,C_EMP_ID,D_MOD_DT from TQC_FACE_ROLL ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TQC_FACE_ROLL model = new Mod_TQC_FACE_ROLL();
            DataSet           ds    = DbHelperOra.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Mod_TQC_FACE_ROLL model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TQC_FACE_ROLL(");
            strSql.Append("C_ROLL_ID,C_STOVE,C_BATCH_NO,C_TICK_NO,C_STL_GRD,N_WGT,C_STD_CODE,C_SPEC,C_MAT_CODE,C_MAT_NAME,C_SHIFT,C_GROUP,C_JUDGE_LEV,C_REASON_NAME,C_REASON_CODE,C_REASON_DEPMT_ID,C_REASON_DEPMT_DESC,C_SUGGESTION,N_STATUS,C_REMARK,C_EMP_ID)");
            strSql.Append(" values (");
            strSql.Append(":C_ROLL_ID,:C_STOVE,:C_BATCH_NO,:C_TICK_NO,:C_STL_GRD,:N_WGT,:C_STD_CODE,:C_SPEC,:C_MAT_CODE,:C_MAT_NAME,:C_SHIFT,:C_GROUP,:C_JUDGE_LEV,:C_REASON_NAME,:C_REASON_CODE,:C_REASON_DEPMT_ID,:C_REASON_DEPMT_DESC,:C_SUGGESTION,:N_STATUS,:C_REMARK,:C_EMP_ID)");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ROLL_ID",           OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STOVE",             OracleDbType.Varchar2, 100),
                new OracleParameter(":C_BATCH_NO",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_TICK_NO",           OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STL_GRD",           OracleDbType.Varchar2, 100),
                new OracleParameter(":N_WGT",               OracleDbType.Double,    15),
                new OracleParameter(":C_STD_CODE",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SPEC",              OracleDbType.Varchar2, 100),
                new OracleParameter(":C_MAT_CODE",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_MAT_NAME",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SHIFT",             OracleDbType.Varchar2, 100),
                new OracleParameter(":C_GROUP",             OracleDbType.Varchar2, 100),
                new OracleParameter(":C_JUDGE_LEV",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_REASON_NAME",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_REASON_CODE",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_REASON_DEPMT_ID",   OracleDbType.Varchar2, 100),
                new OracleParameter(":C_REASON_DEPMT_DESC", OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SUGGESTION",        OracleDbType.Varchar2, 100),
                new OracleParameter(":N_STATUS",            OracleDbType.Decimal,    1),
                new OracleParameter(":C_REMARK",            OracleDbType.Varchar2, 500),
                new OracleParameter(":C_EMP_ID",            OracleDbType.Varchar2, 100)
            };
            parameters[0].Value  = model.C_ROLL_ID;
            parameters[1].Value  = model.C_STOVE;
            parameters[2].Value  = model.C_BATCH_NO;
            parameters[3].Value  = model.C_TICK_NO;
            parameters[4].Value  = model.C_STL_GRD;
            parameters[5].Value  = model.N_WGT;
            parameters[6].Value  = model.C_STD_CODE;
            parameters[7].Value  = model.C_SPEC;
            parameters[8].Value  = model.C_MAT_CODE;
            parameters[9].Value  = model.C_MAT_NAME;
            parameters[10].Value = model.C_SHIFT;
            parameters[11].Value = model.C_GROUP;
            parameters[12].Value = model.C_JUDGE_LEV;
            parameters[13].Value = model.C_REASON_NAME;
            parameters[14].Value = model.C_REASON_CODE;
            parameters[15].Value = model.C_REASON_DEPMT_ID;
            parameters[16].Value = model.C_REASON_DEPMT_DESC;
            parameters[17].Value = model.C_SUGGESTION;
            parameters[18].Value = model.N_STATUS;
            parameters[19].Value = model.C_REMARK;
            parameters[20].Value = model.C_EMP_ID;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TQC_FACE_ROLL DataRowToModel(DataRow row)
        {
            Mod_TQC_FACE_ROLL model = new Mod_TQC_FACE_ROLL();

            if (row != null)
            {
                if (row["C_ID"] != null)
                {
                    model.C_ID = row["C_ID"].ToString();
                }
                if (row["C_ROLL_ID"] != null)
                {
                    model.C_ROLL_ID = row["C_ROLL_ID"].ToString();
                }
                if (row["C_STOVE"] != null)
                {
                    model.C_STOVE = row["C_STOVE"].ToString();
                }
                if (row["C_BATCH_NO"] != null)
                {
                    model.C_BATCH_NO = row["C_BATCH_NO"].ToString();
                }
                if (row["C_TICK_NO"] != null)
                {
                    model.C_TICK_NO = row["C_TICK_NO"].ToString();
                }
                if (row["C_STL_GRD"] != null)
                {
                    model.C_STL_GRD = row["C_STL_GRD"].ToString();
                }
                if (row["N_WGT"] != null && row["N_WGT"].ToString() != "")
                {
                    model.N_WGT = decimal.Parse(row["N_WGT"].ToString());
                }
                if (row["C_STD_CODE"] != null)
                {
                    model.C_STD_CODE = row["C_STD_CODE"].ToString();
                }
                if (row["C_SPEC"] != null)
                {
                    model.C_SPEC = row["C_SPEC"].ToString();
                }
                if (row["C_MAT_CODE"] != null)
                {
                    model.C_MAT_CODE = row["C_MAT_CODE"].ToString();
                }
                if (row["C_MAT_NAME"] != null)
                {
                    model.C_MAT_NAME = row["C_MAT_NAME"].ToString();
                }
                if (row["C_SHIFT"] != null)
                {
                    model.C_SHIFT = row["C_SHIFT"].ToString();
                }
                if (row["C_GROUP"] != null)
                {
                    model.C_GROUP = row["C_GROUP"].ToString();
                }
                if (row["C_JUDGE_LEV"] != null)
                {
                    model.C_JUDGE_LEV = row["C_JUDGE_LEV"].ToString();
                }
                if (row["C_REASON_NAME"] != null)
                {
                    model.C_REASON_NAME = row["C_REASON_NAME"].ToString();
                }
                if (row["C_REASON_CODE"] != null)
                {
                    model.C_REASON_CODE = row["C_REASON_CODE"].ToString();
                }
                if (row["C_REASON_DEPMT_ID"] != null)
                {
                    model.C_REASON_DEPMT_ID = row["C_REASON_DEPMT_ID"].ToString();
                }
                if (row["C_REASON_DEPMT_DESC"] != null)
                {
                    model.C_REASON_DEPMT_DESC = row["C_REASON_DEPMT_DESC"].ToString();
                }
                if (row["C_SUGGESTION"] != null)
                {
                    model.C_SUGGESTION = row["C_SUGGESTION"].ToString();
                }
                if (row["N_STATUS"] != null && row["N_STATUS"].ToString() != "")
                {
                    model.N_STATUS = decimal.Parse(row["N_STATUS"].ToString());
                }
                if (row["C_REMARK"] != null)
                {
                    model.C_REMARK = row["C_REMARK"].ToString();
                }
                if (row["C_EMP_ID"] != null)
                {
                    model.C_EMP_ID = row["C_EMP_ID"].ToString();
                }
                if (row["D_MOD_DT"] != null && row["D_MOD_DT"].ToString() != "")
                {
                    model.D_MOD_DT = DateTime.Parse(row["D_MOD_DT"].ToString());
                }
            }
            return(model);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Mod_TQC_FACE_ROLL model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TQC_FACE_ROLL set ");
            strSql.Append("C_ROLL_ID=:C_ROLL_ID,");
            strSql.Append("C_STOVE=:C_STOVE,");
            strSql.Append("C_BATCH_NO=:C_BATCH_NO,");
            strSql.Append("C_TICK_NO=:C_TICK_NO,");
            strSql.Append("C_STL_GRD=:C_STL_GRD,");
            strSql.Append("N_WGT=:N_WGT,");
            strSql.Append("C_STD_CODE=:C_STD_CODE,");
            strSql.Append("C_SPEC=:C_SPEC,");
            strSql.Append("C_MAT_CODE=:C_MAT_CODE,");
            strSql.Append("C_MAT_NAME=:C_MAT_NAME,");
            strSql.Append("C_SHIFT=:C_SHIFT,");
            strSql.Append("C_GROUP=:C_GROUP,");
            strSql.Append("C_JUDGE_LEV=:C_JUDGE_LEV,");
            strSql.Append("C_REASON_NAME=:C_REASON_NAME,");
            strSql.Append("C_REASON_CODE=:C_REASON_CODE,");
            strSql.Append("C_REASON_DEPMT_ID=:C_REASON_DEPMT_ID,");
            strSql.Append("C_REASON_DEPMT_DESC=:C_REASON_DEPMT_DESC,");
            strSql.Append("C_SUGGESTION=:C_SUGGESTION,");
            strSql.Append("N_STATUS=:N_STATUS,");
            strSql.Append("C_REMARK=:C_REMARK,");
            strSql.Append("C_EMP_ID=:C_EMP_ID,");
            strSql.Append("D_MOD_DT=:D_MOD_DT");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ROLL_ID",           OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STOVE",             OracleDbType.Varchar2, 100),
                new OracleParameter(":C_BATCH_NO",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_TICK_NO",           OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STL_GRD",           OracleDbType.Varchar2, 100),
                new OracleParameter(":N_WGT",               OracleDbType.Double,    15),
                new OracleParameter(":C_STD_CODE",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SPEC",              OracleDbType.Varchar2, 100),
                new OracleParameter(":C_MAT_CODE",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_MAT_NAME",          OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SHIFT",             OracleDbType.Varchar2, 100),
                new OracleParameter(":C_GROUP",             OracleDbType.Varchar2, 100),
                new OracleParameter(":C_JUDGE_LEV",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_REASON_NAME",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_REASON_CODE",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_REASON_DEPMT_ID",   OracleDbType.Varchar2, 100),
                new OracleParameter(":C_REASON_DEPMT_DESC", OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SUGGESTION",        OracleDbType.Varchar2, 100),
                new OracleParameter(":N_STATUS",            OracleDbType.Decimal,    1),
                new OracleParameter(":C_REMARK",            OracleDbType.Varchar2, 500),
                new OracleParameter(":C_EMP_ID",            OracleDbType.Varchar2, 100),
                new OracleParameter(":D_MOD_DT",            OracleDbType.Date),
                new OracleParameter(":C_ID",                OracleDbType.Varchar2, 100)
            };
            parameters[0].Value  = model.C_ROLL_ID;
            parameters[1].Value  = model.C_STOVE;
            parameters[2].Value  = model.C_BATCH_NO;
            parameters[3].Value  = model.C_TICK_NO;
            parameters[4].Value  = model.C_STL_GRD;
            parameters[5].Value  = model.N_WGT;
            parameters[6].Value  = model.C_STD_CODE;
            parameters[7].Value  = model.C_SPEC;
            parameters[8].Value  = model.C_MAT_CODE;
            parameters[9].Value  = model.C_MAT_NAME;
            parameters[10].Value = model.C_SHIFT;
            parameters[11].Value = model.C_GROUP;
            parameters[12].Value = model.C_JUDGE_LEV;
            parameters[13].Value = model.C_REASON_NAME;
            parameters[14].Value = model.C_REASON_CODE;
            parameters[15].Value = model.C_REASON_DEPMT_ID;
            parameters[16].Value = model.C_REASON_DEPMT_DESC;
            parameters[17].Value = model.C_SUGGESTION;
            parameters[18].Value = model.N_STATUS;
            parameters[19].Value = model.C_REMARK;
            parameters[20].Value = model.C_EMP_ID;
            parameters[21].Value = model.D_MOD_DT;
            parameters[22].Value = model.C_ID;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Mod_TQC_FACE_ROLL model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 6
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Mod_TQC_FACE_ROLL model)
 {
     return(dal.Add(model));
 }
Exemplo n.º 7
0
        /// <summary>
        /// 判定
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Decide_Click(object sender, EventArgs e)
        {
            try
            {
                if (imgcbo_PDDJ.EditValue == null)
                {
                    MessageBox.Show("判定顶级不能为空!");
                    return;
                }
                if (imgcbo_PDDJ.SelectedItem.ToString() != "A")
                {
                    if (imgcbo_BHGLX.EditValue == null)
                    {
                        MessageBox.Show("不合格类型不能为空!");
                        return;
                    }
                    if (imgcbo_BHGYY.EditValue == null)
                    {
                        MessageBox.Show("不合格原因不能为空!");
                        return;
                    }

                    if (string.IsNullOrEmpty(imgcbo_ZRDW.Text))
                    {
                        MessageBox.Show("责任部门不能为空!");
                        return;
                    }
                }

                int[] rownumber = gv_right.GetSelectedRows();//获取选中行号数组;
                if (rownumber.Length == 0)
                {
                    MessageBox.Show("请选择需要表判的信息!");
                    return;
                }
                for (int i = 0; i < rownumber.Length; i++)
                {
                    int               selectedHandle = rownumber[i];
                    string            strID          = gv_right.GetRowCellValue(selectedHandle, "C_ID").ToString();
                    DataTable         dt             = bll_TRC_Roll_Product.GetList_ID(strID).Tables[0];
                    Mod_TQC_FACE_ROLL mod            = new Mod_TQC_FACE_ROLL
                    {
                        C_ID        = "",
                        C_ROLL_ID   = dt.Rows[0]["C_ID"].ToString(),
                        C_STOVE     = dt.Rows[0]["C_STOVE"].ToString(),
                        C_BATCH_NO  = dt.Rows[0]["C_BATCH_NO"].ToString(),
                        C_TICK_NO   = dt.Rows[0]["C_TICK_NO"].ToString(),
                        C_STL_GRD   = dt.Rows[0]["C_STL_GRD"].ToString(),
                        N_WGT       = Convert.ToInt32(dt.Rows[0]["N_WGT"]),
                        C_STD_CODE  = dt.Rows[0]["C_STD_CODE"].ToString(),
                        C_SPEC      = dt.Rows[0]["C_SPEC"].ToString(),
                        C_MAT_CODE  = dt.Rows[0]["C_MAT_CODE"].ToString(),
                        C_MAT_NAME  = dt.Rows[0]["C_MAT_DESC"].ToString(),
                        C_SHIFT     = dt.Rows[0]["C_SHIFT"].ToString(),
                        C_GROUP     = dt.Rows[0]["C_GROUP"].ToString(),
                        C_JUDGE_LEV = imgcbo_PDDJ.Text,

                        C_REASON_NAME       = imgcbo_BHGYY.Text,
                        C_REASON_CODE       = imgcbo_BHGLX.Text,
                        C_REASON_DEPMT_ID   = imgcbo_ZRDW.EditValue.ToString(),
                        C_REASON_DEPMT_DESC = imgcbo_ZRDW.Text,
                        C_SUGGESTION        = txt_CZYJ.Text,
                        C_REMARK            = txt_Remark.Text,
                        C_EMP_ID            = RV.UI.UserInfo.UserID
                    };
                    bll_face_roll.Add(mod);

                    Mod_TRC_ROLL_PRODCUT mod_trc = bll_TRC_Roll_Product.GetModel(strID);
                    mod_trc.C_JUDGE_LEV_BP = imgcbo_PDDJ.Text;
                    bool res = bll_TRC_Roll_Product.Update(mod_trc);

                    Mod_TQC_FACE_ROLL_LOG mod_log = new Mod_TQC_FACE_ROLL_LOG();//操作记录表
                    mod_log.C_ID                = "";
                    mod_log.C_ROLL_ID           = dt.Rows[0]["C_ID"].ToString();
                    mod_log.C_STOVE             = dt.Rows[0]["C_STOVE"].ToString();
                    mod_log.C_BATCH_NO          = dt.Rows[0]["C_BATCH_NO"].ToString();
                    mod_log.C_TICK_NO           = dt.Rows[0]["C_TICK_NO"].ToString();
                    mod_log.C_STL_GRD           = dt.Rows[0]["C_STL_GRD"].ToString();
                    mod_log.N_WGT               = Convert.ToInt32(dt.Rows[0]["N_WGT"]);
                    mod_log.C_STD_CODE          = dt.Rows[0]["C_STD_CODE"].ToString();
                    mod_log.C_SPEC              = dt.Rows[0]["C_SPEC"].ToString();
                    mod_log.C_MAT_CODE          = dt.Rows[0]["C_MAT_CODE"].ToString();
                    mod_log.C_MAT_NAME          = dt.Rows[0]["C_MAT_DESC"].ToString();
                    mod_log.C_SHIFT             = dt.Rows[0]["C_SHIFT"].ToString();
                    mod_log.C_GROUP             = dt.Rows[0]["C_GROUP"].ToString();
                    mod_log.C_JUDGE_LEV         = imgcbo_PDDJ.Text;
                    mod_log.C_REASON_NAME       = imgcbo_BHGYY.Text;
                    mod_log.C_REASON_CODE       = imgcbo_BHGLX.Text;
                    mod_log.C_REASON_DEPMT_ID   = imgcbo_ZRDW.EditValue.ToString();
                    mod_log.C_REASON_DEPMT_DESC = imgcbo_ZRDW.Text;
                    mod_log.C_SUGGESTION        = txt_CZYJ.Text;
                    mod_log.C_REMARK            = "判定";
                    mod_log.C_EMP_ID            = RV.UI.UserInfo.UserID;
                    bll_face_roll_log.Add(mod_log);//添加判定操作记录
                }

                Common.UserLog.AddLog(strMenuName, this.Name, this.Text, "线材表面判定");//添加操作日志

                btn_Query_Main_Click(null, null);
                btn_Query_Click(null, null);
                MessageBox.Show("判定成功!");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }