Ejemplo n.º 1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Mod_TQB_RINSE_TANK_GRD model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TQB_RINSE_TANK_GRD(");
            strSql.Append("N_STATUS,C_REMARK,C_EMP_ID,D_MOD_DT,C_STD_CODE,C_STL_GRD)");
            strSql.Append(" values (");
            strSql.Append(":N_STATUS,:C_REMARK,:C_EMP_ID,:D_MOD_DT,:C_STD_CODE,:C_STL_GRD)");
            OracleParameter[] parameters =
            {
                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_STD_CODE", OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STL_GRD",  OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = model.N_STATUS;
            parameters[1].Value = model.C_REMARK;
            parameters[2].Value = model.C_EMP_ID;
            parameters[3].Value = model.D_MOD_DT;
            parameters[4].Value = model.C_STD_CODE;
            parameters[5].Value = model.C_STL_GRD;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Add_Click(object sender, EventArgs e)
        {
            int[] rownumber = gv_std_main.GetSelectedRows();//获取选中行号数组;
            if (rownumber.Length == 0)
            {
                MessageBox.Show("请选择需要添加的信息!");
                return;
            }

            string strUserID = RV.UI.UserInfo.UserID;

            for (int i = 0; i < rownumber.Length; i++)
            {
                int                    selectedHandle = rownumber[i];
                string                 strID          = gv_std_main.GetRowCellValue(selectedHandle, "C_ID").ToString();
                Mod_TQB_STD_MAIN       mod_ID         = bllStdMain.GetModel(strID);
                Mod_TQB_RINSE_TANK_GRD mod            = new Mod_TQB_RINSE_TANK_GRD();
                mod.C_STD_CODE = mod_ID.C_STD_CODE;
                mod.C_STL_GRD  = mod_ID.C_STL_GRD;
                mod.C_EMP_ID   = strUserID;

                bllRinseTank.Add(mod);
            }
            NewMethod();
            NewMethod1();
            MessageBox.Show("添加成功!");

            Common.UserLog.AddLog(strMenuName, this.Name, this.Text, "添加涮槽钢种");//添加操作日志
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Mod_TQB_RINSE_TANK_GRD model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TQB_RINSE_TANK_GRD set ");
            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("C_STD_CODE=:C_STD_CODE,");
            strSql.Append("C_STL_GRD=:C_STL_GRD");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                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_STD_CODE", OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STL_GRD",  OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ID",       OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = model.N_STATUS;
            parameters[1].Value = model.C_REMARK;
            parameters[2].Value = model.C_EMP_ID;
            parameters[3].Value = model.D_MOD_DT;
            parameters[4].Value = model.C_STD_CODE;
            parameters[5].Value = model.C_STL_GRD;
            parameters[6].Value = model.C_ID;

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

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

            if (row != null)
            {
                if (row["C_ID"] != null)
                {
                    model.C_ID = row["C_ID"].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());
                }
                if (row["C_STD_CODE"] != null)
                {
                    model.C_STD_CODE = row["C_STD_CODE"].ToString();
                }
                if (row["C_STL_GRD"] != null)
                {
                    model.C_STL_GRD = row["C_STL_GRD"].ToString();
                }
            }
            return(model);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TQB_RINSE_TANK_GRD GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,N_STATUS,C_REMARK,C_EMP_ID,D_MOD_DT,C_STD_CODE,C_STL_GRD from TQB_RINSE_TANK_GRD ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

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

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Mod_TQB_RINSE_TANK_GRD model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Mod_TQB_RINSE_TANK_GRD model)
 {
     return(dal.Add(model));
 }