コード例 #1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TRC_ROLL_PDD_ITEM GetModel(string C_YSDH, string C_MATCODE, string C_PCH, string C_SX, string C_FREE1, string C_FREE2, string C_FREE3)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_YSDH,C_MATCODE,C_PCH,C_SX,C_ZCSL,C_FZCZL,C_FREE0,C_FREE1,C_FREE2,C_FREE3,C_FREE4,C_ID,D_INSERT,C_REMARK,N_STATUS,C_CK,C_MATDESC,C_SPEC,C_STL_GRD,C_NC_SL,C_NC_ZL,C_CAP_SL,C_CAP_ZL,C_RF_SL,C_RF_ZL,C_RF_SJ_SL,C_RF_SJ_ZL,C_NC_CAP_SL,C_NC_CAP_ZL,C_RF_CAP_SL,C_RF_CAP_ZL,C_CAP_SJ_SL,C_CAP_SJ_ZL from TRC_ROLL_PDD_ITEM ");
            strSql.Append(" where C_YSDH='" + C_YSDH + "' and C_MATCODE='" + C_MATCODE + "' and C_PCH='" + C_PCH + "' and C_SX='" + C_SX + "' and C_FREE1='" + C_FREE1 + "' and C_FREE2='" + C_FREE2 + "' and C_FREE3='" + C_FREE3 + "' ");

            Mod_TRC_ROLL_PDD_ITEM model = new Mod_TRC_ROLL_PDD_ITEM();
            DataSet ds = DbHelperOra.Query(strSql.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TRC_ROLL_PDD_ITEM GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_YSDH,C_MATCODE,C_PCH,C_SX,C_ZCSL,C_FZCZL,C_FREE0,C_FREE1,C_FREE2,C_FREE3,C_FREE4,C_ID,D_INSERT,C_REMARK,N_STATUS,C_CK,C_MATDESC,C_SPEC,C_STL_GRD,C_NC_SL,C_NC_ZL,C_CAP_SL,C_CAP_ZL,C_RF_SL,C_RF_ZL,C_RF_SJ_SL,C_RF_SJ_ZL,C_NC_CAP_SL,C_NC_CAP_ZL,C_RF_CAP_SL,C_RF_CAP_ZL,C_CAP_SJ_SL,C_CAP_SJ_ZL from TRC_ROLL_PDD_ITEM ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

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

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
コード例 #3
0
        /// <summary>
        /// 同步条码盘点结果信息
        /// </summary>
        /// <returns></returns>
        public string TB_RF_PD_Result()
        {
            string result = "1";

            try
            {
                TransactionHelper.BeginTransaction();
                TransactionHelper_SQL.BeginTransaction();

                string   userID = RV.UI.UserInfo.UserID;
                DateTime dTime  = RV.UI.ServerTime.timeNow();

                Dal_TRC_ROLL_PDD_ITEM dalRollPddItem = new Dal_TRC_ROLL_PDD_ITEM();

                DataTable dtMain = dal.Get_PD_List().Tables[0];

                if (dtMain.Rows.Count > 0)
                {
                    for (int i = 0; i < dtMain.Rows.Count; i++)
                    {
                        DataTable dtItem = dal.Get_PD_ITEM_List(dtMain.Rows[i]["ysdh"].ToString()).Tables[0];

                        for (int mm = 0; mm < dtItem.Rows.Count; mm++)
                        {
                            Mod_TRC_ROLL_PDD_ITEM model_Item = dalRollPddItem.GetModel(dtItem.Rows[mm]["YSDH"].ToString(), dtItem.Rows[mm]["BARCODE"].ToString(), dtItem.Rows[mm]["PCH"].ToString(), dtItem.Rows[mm]["SX"].ToString(), dtItem.Rows[mm]["vfree1"].ToString(), dtItem.Rows[mm]["vfree2"].ToString(), dtItem.Rows[mm]["vfree3"].ToString());
                            if (model_Item != null)
                            {
                                model_Item.C_RF_SJ_SL = Convert.ToDecimal(dtItem.Rows[mm]["SPSL"].ToString());
                                model_Item.C_RF_SJ_ZL = Convert.ToDecimal(dtItem.Rows[mm]["SPZL"].ToString());

                                model_Item.C_CAP_SJ_SL = model_Item.C_CAP_SL - model_Item.C_RF_SJ_SL;
                                model_Item.C_CAP_SJ_ZL = model_Item.C_CAP_ZL - model_Item.C_RF_SJ_ZL;

                                if (!dalRollPddItem.Update_Trans(model_Item))
                                {
                                    TransactionHelper.RollBack();
                                    TransactionHelper_SQL.RollBack();
                                    return("更新实盘重量失败!");
                                }
                            }
                        }

                        string strSql = "update SeZJB_PDD_FINISHED set ZJBstatus=1 where ysdh='" + dtMain.Rows[i]["ysdh"].ToString() + "' ";

                        if (!dal.Update_RF_Trans(strSql))
                        {
                            TransactionHelper.RollBack();
                            TransactionHelper_SQL.RollBack();
                            return("更新条码盘点表状态失败!");
                        }
                    }
                }
                else
                {
                    TransactionHelper.RollBack();
                    TransactionHelper_SQL.RollBack();
                    return("没有需要同步的盘点信息!");
                }

                TransactionHelper.Commit();
                TransactionHelper_SQL.Commit();
            }
            catch (Exception ex)
            {
                TransactionHelper.RollBack();
                TransactionHelper_SQL.RollBack();
                return(ex.Message);
            }

            return(result);
        }
コード例 #4
0
        /// <summary>
        /// 下发条码
        /// </summary>
        /// <returns></returns>
        public string Down_RF(DataTable dt)
        {
            string result = "1";

            try
            {
                TransactionHelper.BeginTransaction();
                TransactionHelper_SQL.BeginTransaction();

                string   userID = RV.UI.UserInfo.UserID;
                DateTime dTime  = RV.UI.ServerTime.timeNow();

                Dal_TRC_ROLL_PDD_ITEM dalRollPddItem = new Dal_TRC_ROLL_PDD_ITEM();
                Dal_TPB_LINEWH        dalTpbLineWh   = new Dal_TPB_LINEWH();

                Int64 i_ID_Main = 0;
                Int64 i_ID_Item = 0;

                string s_id_main = dal.Get_Max_ID();
                if (string.IsNullOrEmpty(s_id_main))
                {
                    i_ID_Main = 20190200000;
                }
                else
                {
                    i_ID_Main = Convert.ToInt64(s_id_main) + 1;
                }

                string s_id_item = dalRollPddItem.Get_Max_ID();
                if (string.IsNullOrEmpty(s_id_item))
                {
                    i_ID_Item = 2019022500000;
                }
                else
                {
                    i_ID_Item = Convert.ToInt64(s_id_item) + 1;
                }

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (dt.Rows[i]["条码账存卷数"].ToString() == "0")
                    {
                        continue;
                    }

                    string NC_CK_ID = dalTpbLineWh.GetList_id(dt.Rows[i]["仓库"].ToString()).ToString();

                    string strDH = dal.Get_PDDH(dTime.ToString(), dt.Rows[i]["仓库"].ToString());

                    if (string.IsNullOrEmpty(strDH))
                    {
                        strDH = dal.Get_Max_PDDH(dTime.ToString());
                        if (string.IsNullOrEmpty(strDH))
                        {
                            strDH = "PD" + dTime.ToString("yyyyMMdd") + "0001";
                        }
                        else
                        {
                            strDH = "PD" + (Convert.ToUInt64(strDH) + 1).ToString();
                        }

                        i_ID_Main++;

                        Mod_TRC_ROLL_PDD modPdd = new Mod_TRC_ROLL_PDD();
                        modPdd.C_ID     = i_ID_Main.ToString();
                        modPdd.C_CK     = dt.Rows[i]["仓库"].ToString();
                        modPdd.D_PDRQ   = dTime;
                        modPdd.C_YSDH   = strDH;
                        modPdd.D_INSERT = dTime;
                        if (!dal.Add_Trans(modPdd))
                        {
                            TransactionHelper.RollBack();
                            TransactionHelper_SQL.RollBack();
                            return("往CAP盘点主表插入失败!");
                        }


                        string strSql = "insert into ReZJB_PDD(ZJBstatus,CAPPK,ck,pdrq,ysdh,insertts,beizhu)values('0','" + i_ID_Main.ToString() + "','" + NC_CK_ID + "','" + dTime + "','" + strDH + "','" + dTime + "','') ";

                        if (!dal.Add_RF_Trans(strSql))
                        {
                            TransactionHelper.RollBack();
                            TransactionHelper_SQL.RollBack();
                            return("往RF盘点主表插入失败!");
                        }
                    }

                    i_ID_Item++;

                    Mod_TRC_ROLL_PDD_ITEM modItem = new Mod_TRC_ROLL_PDD_ITEM();
                    modItem.C_YSDH    = strDH;
                    modItem.C_MATCODE = dt.Rows[i]["物料号"].ToString();
                    modItem.C_PCH     = dt.Rows[i]["批次号"].ToString();
                    modItem.C_SX      = dt.Rows[i]["质量等级"].ToString();
                    //modItem.C_ZCSL = dt.Rows[i]["仓库"].ToString();
                    //modItem.C_FZCZL = dt.Rows[i]["仓库"].ToString();
                    //modItem.C_FREE0 = "";
                    modItem.C_FREE1 = dt.Rows[i]["自由项1"].ToString();
                    modItem.C_FREE2 = dt.Rows[i]["自由项2"].ToString();
                    modItem.C_FREE3 = dt.Rows[i]["自由项3"].ToString();
                    //modItem.C_FREE4 = "";
                    modItem.C_ID     = i_ID_Item.ToString();
                    modItem.D_INSERT = dTime;
                    //modItem.C_REMARK = "";
                    modItem.C_CK      = dt.Rows[i]["仓库"].ToString();
                    modItem.C_MATDESC = dt.Rows[i]["物料名称"].ToString();
                    modItem.C_SPEC    = dt.Rows[i]["规格"].ToString();
                    modItem.C_STL_GRD = dt.Rows[i]["钢种"].ToString();
                    modItem.C_NC_SL   = Convert.ToDecimal(dt.Rows[i]["NC账存卷数"].ToString());
                    modItem.C_NC_ZL   = Convert.ToDecimal(dt.Rows[i]["NC账存数量"].ToString());
                    modItem.C_CAP_SL  = Convert.ToDecimal(dt.Rows[i]["CAP账存卷数"].ToString());
                    modItem.C_CAP_ZL  = Convert.ToDecimal(dt.Rows[i]["CAP账存数量"].ToString());
                    modItem.C_RF_SL   = Convert.ToDecimal(dt.Rows[i]["条码账存卷数"].ToString());
                    modItem.C_RF_ZL   = Convert.ToDecimal(dt.Rows[i]["条码账存数量"].ToString());
                    //modItem.C_RF_SJ_SL = dt.Rows[i]["仓库"].ToString();
                    //modItem.C_RF_SJ_ZL = dt.Rows[i]["仓库"].ToString();
                    modItem.C_NC_CAP_SL = Convert.ToDecimal(dt.Rows[i]["NC与CAP卷数账差"].ToString());
                    modItem.C_NC_CAP_ZL = Convert.ToDecimal(dt.Rows[i]["NC与CAP数量账差"].ToString());
                    modItem.C_RF_CAP_SL = Convert.ToDecimal(dt.Rows[i]["条码与CAP卷数账差"].ToString());
                    modItem.C_RF_CAP_ZL = Convert.ToDecimal(dt.Rows[i]["条码与CAP数量账差"].ToString());
                    //modItem.C_CAP_SJ_SL = Convert.ToDecimal(dt.Rows[i]["CAP与实盘卷数差异"].ToString());
                    //modItem.C_CAP_SJ_ZL = Convert.ToDecimal(dt.Rows[i]["CAP与实盘数量差异"].ToString());

                    if (!dalRollPddItem.Add_Trans(modItem))
                    {
                        TransactionHelper.RollBack();
                        TransactionHelper_SQL.RollBack();
                        return("往CAP盘点明细表插入失败!");
                    }


                    string strSql_Item = "insert into ReZJB_PDD_Item(ysdh,BARCODE,PCH,SX,ZCSL,FZCZL,vfree0,vfree1,vfree2,vfree3,vfree4,ZJBstatus,CAPPK,insertts)values('" + strDH + "','" + dt.Rows[i]["物料号"].ToString() + "','" + dt.Rows[i]["批次号"].ToString() + "','" + dt.Rows[i]["质量等级"].ToString() + "','" + dt.Rows[i]["条码账存卷数"].ToString() + "','" + dt.Rows[i]["条码账存数量"].ToString() + "','','" + dt.Rows[i]["自由项1"].ToString() + "','" + dt.Rows[i]["自由项2"].ToString() + "','" + dt.Rows[i]["自由项3"].ToString() + "','','0','" + i_ID_Item.ToString() + "','" + dTime + "' ) ";

                    if (!dal.Add_RF_Trans(strSql_Item))
                    {
                        TransactionHelper.RollBack();
                        TransactionHelper_SQL.RollBack();
                        return("往RF盘点主表插入失败!");
                    }
                }

                TransactionHelper.Commit();
                TransactionHelper_SQL.Commit();
            }
            catch (Exception ex)
            {
                TransactionHelper.RollBack();
                TransactionHelper_SQL.RollBack();
                return(ex.Message);
            }

            return(result);
        }
コード例 #5
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Mod_TRC_ROLL_PDD_ITEM model)
 {
     return(dal.Update(model));
 }
コード例 #6
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Mod_TRC_ROLL_PDD_ITEM model)
 {
     return(dal.Add(model));
 }
コード例 #7
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TRC_ROLL_PDD_ITEM DataRowToModel(DataRow row)
        {
            Mod_TRC_ROLL_PDD_ITEM model = new Mod_TRC_ROLL_PDD_ITEM();

            if (row != null)
            {
                if (row["C_YSDH"] != null)
                {
                    model.C_YSDH = row["C_YSDH"].ToString();
                }
                if (row["C_MATCODE"] != null)
                {
                    model.C_MATCODE = row["C_MATCODE"].ToString();
                }
                if (row["C_PCH"] != null)
                {
                    model.C_PCH = row["C_PCH"].ToString();
                }
                if (row["C_SX"] != null)
                {
                    model.C_SX = row["C_SX"].ToString();
                }
                if (row["C_ZCSL"] != null && row["C_ZCSL"].ToString() != "")
                {
                    model.C_ZCSL = decimal.Parse(row["C_ZCSL"].ToString());
                }
                if (row["C_FZCZL"] != null && row["C_FZCZL"].ToString() != "")
                {
                    model.C_FZCZL = decimal.Parse(row["C_FZCZL"].ToString());
                }
                if (row["C_FREE0"] != null)
                {
                    model.C_FREE0 = row["C_FREE0"].ToString();
                }
                if (row["C_FREE1"] != null)
                {
                    model.C_FREE1 = row["C_FREE1"].ToString();
                }
                if (row["C_FREE2"] != null)
                {
                    model.C_FREE2 = row["C_FREE2"].ToString();
                }
                if (row["C_FREE3"] != null)
                {
                    model.C_FREE3 = row["C_FREE3"].ToString();
                }
                if (row["C_FREE4"] != null)
                {
                    model.C_FREE4 = row["C_FREE4"].ToString();
                }
                if (row["C_ID"] != null)
                {
                    model.C_ID = row["C_ID"].ToString();
                }
                if (row["D_INSERT"] != null && row["D_INSERT"].ToString() != "")
                {
                    model.D_INSERT = DateTime.Parse(row["D_INSERT"].ToString());
                }
                if (row["C_REMARK"] != null)
                {
                    model.C_REMARK = row["C_REMARK"].ToString();
                }
                if (row["N_STATUS"] != null && row["N_STATUS"].ToString() != "")
                {
                    model.N_STATUS = decimal.Parse(row["N_STATUS"].ToString());
                }
                if (row["C_CK"] != null)
                {
                    model.C_CK = row["C_CK"].ToString();
                }
                if (row["C_MATDESC"] != null)
                {
                    model.C_MATDESC = row["C_MATDESC"].ToString();
                }
                if (row["C_SPEC"] != null)
                {
                    model.C_SPEC = row["C_SPEC"].ToString();
                }
                if (row["C_STL_GRD"] != null)
                {
                    model.C_STL_GRD = row["C_STL_GRD"].ToString();
                }
                if (row["C_NC_SL"] != null && row["C_NC_SL"].ToString() != "")
                {
                    model.C_NC_SL = decimal.Parse(row["C_NC_SL"].ToString());
                }
                if (row["C_NC_ZL"] != null && row["C_NC_ZL"].ToString() != "")
                {
                    model.C_NC_ZL = decimal.Parse(row["C_NC_ZL"].ToString());
                }
                if (row["C_CAP_SL"] != null && row["C_CAP_SL"].ToString() != "")
                {
                    model.C_CAP_SL = decimal.Parse(row["C_CAP_SL"].ToString());
                }
                if (row["C_CAP_ZL"] != null && row["C_CAP_ZL"].ToString() != "")
                {
                    model.C_CAP_ZL = decimal.Parse(row["C_CAP_ZL"].ToString());
                }
                if (row["C_RF_SL"] != null && row["C_RF_SL"].ToString() != "")
                {
                    model.C_RF_SL = decimal.Parse(row["C_RF_SL"].ToString());
                }
                if (row["C_RF_ZL"] != null && row["C_RF_ZL"].ToString() != "")
                {
                    model.C_RF_ZL = decimal.Parse(row["C_RF_ZL"].ToString());
                }
                if (row["C_RF_SJ_SL"] != null && row["C_RF_SJ_SL"].ToString() != "")
                {
                    model.C_RF_SJ_SL = decimal.Parse(row["C_RF_SJ_SL"].ToString());
                }
                if (row["C_RF_SJ_ZL"] != null && row["C_RF_SJ_ZL"].ToString() != "")
                {
                    model.C_RF_SJ_ZL = decimal.Parse(row["C_RF_SJ_ZL"].ToString());
                }
                if (row["C_NC_CAP_SL"] != null && row["C_NC_CAP_SL"].ToString() != "")
                {
                    model.C_NC_CAP_SL = decimal.Parse(row["C_NC_CAP_SL"].ToString());
                }
                if (row["C_NC_CAP_ZL"] != null && row["C_NC_CAP_ZL"].ToString() != "")
                {
                    model.C_NC_CAP_ZL = decimal.Parse(row["C_NC_CAP_ZL"].ToString());
                }
                if (row["C_RF_CAP_SL"] != null && row["C_RF_CAP_SL"].ToString() != "")
                {
                    model.C_RF_CAP_SL = decimal.Parse(row["C_RF_CAP_SL"].ToString());
                }
                if (row["C_RF_CAP_ZL"] != null && row["C_RF_CAP_ZL"].ToString() != "")
                {
                    model.C_RF_CAP_ZL = decimal.Parse(row["C_RF_CAP_ZL"].ToString());
                }
                if (row["C_CAP_SJ_SL"] != null && row["C_CAP_SJ_SL"].ToString() != "")
                {
                    model.C_CAP_SJ_SL = decimal.Parse(row["C_CAP_SJ_SL"].ToString());
                }
                if (row["C_CAP_SJ_ZL"] != null && row["C_CAP_SJ_ZL"].ToString() != "")
                {
                    model.C_CAP_SJ_ZL = decimal.Parse(row["C_CAP_SJ_ZL"].ToString());
                }
            }
            return(model);
        }
コード例 #8
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Mod_TRC_ROLL_PDD_ITEM model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TRC_ROLL_PDD_ITEM(");
            strSql.Append("C_YSDH,C_MATCODE,C_PCH,C_SX,C_ZCSL,C_FZCZL,C_FREE0,C_FREE1,C_FREE2,C_FREE3,C_FREE4,C_ID,D_INSERT,C_REMARK,N_STATUS,C_CK,C_MATDESC,C_SPEC,C_STL_GRD,C_NC_SL,C_NC_ZL,C_CAP_SL,C_CAP_ZL,C_RF_SL,C_RF_ZL,C_RF_SJ_SL,C_RF_SJ_ZL,C_NC_CAP_SL,C_NC_CAP_ZL,C_RF_CAP_SL,C_RF_CAP_ZL,C_CAP_SJ_SL,C_CAP_SJ_ZL)");
            strSql.Append(" values (");
            strSql.Append(":C_YSDH,:C_MATCODE,:C_PCH,:C_SX,:C_ZCSL,:C_FZCZL,:C_FREE0,:C_FREE1,:C_FREE2,:C_FREE3,:C_FREE4,:C_ID,:D_INSERT,:C_REMARK,:N_STATUS,:C_CK,:C_MATDESC,:C_SPEC,:C_STL_GRD,:C_NC_SL,:C_NC_ZL,:C_CAP_SL,:C_CAP_ZL,:C_RF_SL,:C_RF_ZL,:C_RF_SJ_SL,:C_RF_SJ_ZL,:C_NC_CAP_SL,:C_NC_CAP_ZL,:C_RF_CAP_SL,:C_RF_CAP_ZL,:C_CAP_SJ_SL,:C_CAP_SJ_ZL)");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_YSDH",      OracleDbType.Varchar2, 100),
                new OracleParameter(":C_MATCODE",   OracleDbType.Varchar2, 100),
                new OracleParameter(":C_PCH",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SX",        OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ZCSL",      OracleDbType.Decimal,    4),
                new OracleParameter(":C_FZCZL",     OracleDbType.Decimal,   18),
                new OracleParameter(":C_FREE0",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_FREE1",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_FREE2",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_FREE3",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_FREE4",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ID",        OracleDbType.Varchar2, 100),
                new OracleParameter(":D_INSERT",    OracleDbType.Date),
                new OracleParameter(":C_REMARK",    OracleDbType.Varchar2, 500),
                new OracleParameter(":N_STATUS",    OracleDbType.Decimal,    4),
                new OracleParameter(":C_CK",        OracleDbType.Varchar2, 100),
                new OracleParameter(":C_MATDESC",   OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SPEC",      OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STL_GRD",   OracleDbType.Varchar2, 100),
                new OracleParameter(":C_NC_SL",     OracleDbType.Decimal,    4),
                new OracleParameter(":C_NC_ZL",     OracleDbType.Decimal,   18),
                new OracleParameter(":C_CAP_SL",    OracleDbType.Decimal,    4),
                new OracleParameter(":C_CAP_ZL",    OracleDbType.Decimal,   18),
                new OracleParameter(":C_RF_SL",     OracleDbType.Decimal,    4),
                new OracleParameter(":C_RF_ZL",     OracleDbType.Decimal,   18),
                new OracleParameter(":C_RF_SJ_SL",  OracleDbType.Decimal,    4),
                new OracleParameter(":C_RF_SJ_ZL",  OracleDbType.Decimal,   18),
                new OracleParameter(":C_NC_CAP_SL", OracleDbType.Decimal,    4),
                new OracleParameter(":C_NC_CAP_ZL", OracleDbType.Decimal,   18),
                new OracleParameter(":C_RF_CAP_SL", OracleDbType.Decimal,    4),
                new OracleParameter(":C_RF_CAP_ZL", OracleDbType.Decimal,   18),
                new OracleParameter(":C_CAP_SJ_SL", OracleDbType.Decimal,    4),
                new OracleParameter(":C_CAP_SJ_ZL", OracleDbType.Decimal, 18)
            };
            parameters[0].Value  = model.C_YSDH;
            parameters[1].Value  = model.C_MATCODE;
            parameters[2].Value  = model.C_PCH;
            parameters[3].Value  = model.C_SX;
            parameters[4].Value  = model.C_ZCSL;
            parameters[5].Value  = model.C_FZCZL;
            parameters[6].Value  = model.C_FREE0;
            parameters[7].Value  = model.C_FREE1;
            parameters[8].Value  = model.C_FREE2;
            parameters[9].Value  = model.C_FREE3;
            parameters[10].Value = model.C_FREE4;
            parameters[11].Value = model.C_ID;
            parameters[12].Value = model.D_INSERT;
            parameters[13].Value = model.C_REMARK;
            parameters[14].Value = model.N_STATUS;
            parameters[15].Value = model.C_CK;
            parameters[16].Value = model.C_MATDESC;
            parameters[17].Value = model.C_SPEC;
            parameters[18].Value = model.C_STL_GRD;
            parameters[19].Value = model.C_NC_SL;
            parameters[20].Value = model.C_NC_ZL;
            parameters[21].Value = model.C_CAP_SL;
            parameters[22].Value = model.C_CAP_ZL;
            parameters[23].Value = model.C_RF_SL;
            parameters[24].Value = model.C_RF_ZL;
            parameters[25].Value = model.C_RF_SJ_SL;
            parameters[26].Value = model.C_RF_SJ_ZL;
            parameters[27].Value = model.C_NC_CAP_SL;
            parameters[28].Value = model.C_NC_CAP_ZL;
            parameters[29].Value = model.C_RF_CAP_SL;
            parameters[30].Value = model.C_RF_CAP_ZL;
            parameters[31].Value = model.C_CAP_SJ_SL;
            parameters[32].Value = model.C_CAP_SJ_ZL;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #9
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update_Trans(Mod_TRC_ROLL_PDD_ITEM model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TRC_ROLL_PDD_ITEM set ");
            strSql.Append("C_YSDH=:C_YSDH,");
            strSql.Append("C_MATCODE=:C_MATCODE,");
            strSql.Append("C_PCH=:C_PCH,");
            strSql.Append("C_SX=:C_SX,");
            strSql.Append("C_ZCSL=:C_ZCSL,");
            strSql.Append("C_FZCZL=:C_FZCZL,");
            strSql.Append("C_FREE0=:C_FREE0,");
            strSql.Append("C_FREE1=:C_FREE1,");
            strSql.Append("C_FREE2=:C_FREE2,");
            strSql.Append("C_FREE3=:C_FREE3,");
            strSql.Append("C_FREE4=:C_FREE4,");
            strSql.Append("D_INSERT=:D_INSERT,");
            strSql.Append("C_REMARK=:C_REMARK,");
            strSql.Append("N_STATUS=:N_STATUS,");
            strSql.Append("C_CK=:C_CK,");
            strSql.Append("C_MATDESC=:C_MATDESC,");
            strSql.Append("C_SPEC=:C_SPEC,");
            strSql.Append("C_STL_GRD=:C_STL_GRD,");
            strSql.Append("C_NC_SL=:C_NC_SL,");
            strSql.Append("C_NC_ZL=:C_NC_ZL,");
            strSql.Append("C_CAP_SL=:C_CAP_SL,");
            strSql.Append("C_CAP_ZL=:C_CAP_ZL,");
            strSql.Append("C_RF_SL=:C_RF_SL,");
            strSql.Append("C_RF_ZL=:C_RF_ZL,");
            strSql.Append("C_RF_SJ_SL=:C_RF_SJ_SL,");
            strSql.Append("C_RF_SJ_ZL=:C_RF_SJ_ZL,");
            strSql.Append("C_NC_CAP_SL=:C_NC_CAP_SL,");
            strSql.Append("C_NC_CAP_ZL=:C_NC_CAP_ZL,");
            strSql.Append("C_RF_CAP_SL=:C_RF_CAP_SL,");
            strSql.Append("C_RF_CAP_ZL=:C_RF_CAP_ZL,");
            strSql.Append("C_CAP_SJ_SL=:C_CAP_SJ_SL,");
            strSql.Append("C_CAP_SJ_ZL=:C_CAP_SJ_ZL");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_YSDH",      OracleDbType.Varchar2, 100),
                new OracleParameter(":C_MATCODE",   OracleDbType.Varchar2, 100),
                new OracleParameter(":C_PCH",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SX",        OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ZCSL",      OracleDbType.Decimal,    4),
                new OracleParameter(":C_FZCZL",     OracleDbType.Decimal,   18),
                new OracleParameter(":C_FREE0",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_FREE1",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_FREE2",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_FREE3",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_FREE4",     OracleDbType.Varchar2, 100),
                new OracleParameter(":D_INSERT",    OracleDbType.Date),
                new OracleParameter(":C_REMARK",    OracleDbType.Varchar2, 500),
                new OracleParameter(":N_STATUS",    OracleDbType.Decimal,    4),
                new OracleParameter(":C_CK",        OracleDbType.Varchar2, 100),
                new OracleParameter(":C_MATDESC",   OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SPEC",      OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STL_GRD",   OracleDbType.Varchar2, 100),
                new OracleParameter(":C_NC_SL",     OracleDbType.Decimal,    4),
                new OracleParameter(":C_NC_ZL",     OracleDbType.Decimal,   18),
                new OracleParameter(":C_CAP_SL",    OracleDbType.Decimal,    4),
                new OracleParameter(":C_CAP_ZL",    OracleDbType.Decimal,   18),
                new OracleParameter(":C_RF_SL",     OracleDbType.Decimal,    4),
                new OracleParameter(":C_RF_ZL",     OracleDbType.Decimal,   18),
                new OracleParameter(":C_RF_SJ_SL",  OracleDbType.Decimal,    4),
                new OracleParameter(":C_RF_SJ_ZL",  OracleDbType.Decimal,   18),
                new OracleParameter(":C_NC_CAP_SL", OracleDbType.Decimal,    4),
                new OracleParameter(":C_NC_CAP_ZL", OracleDbType.Decimal,   18),
                new OracleParameter(":C_RF_CAP_SL", OracleDbType.Decimal,    4),
                new OracleParameter(":C_RF_CAP_ZL", OracleDbType.Decimal,   18),
                new OracleParameter(":C_CAP_SJ_SL", OracleDbType.Decimal,    4),
                new OracleParameter(":C_CAP_SJ_ZL", OracleDbType.Decimal,   18),
                new OracleParameter(":C_ID",        OracleDbType.Varchar2, 100)
            };
            parameters[0].Value  = model.C_YSDH;
            parameters[1].Value  = model.C_MATCODE;
            parameters[2].Value  = model.C_PCH;
            parameters[3].Value  = model.C_SX;
            parameters[4].Value  = model.C_ZCSL;
            parameters[5].Value  = model.C_FZCZL;
            parameters[6].Value  = model.C_FREE0;
            parameters[7].Value  = model.C_FREE1;
            parameters[8].Value  = model.C_FREE2;
            parameters[9].Value  = model.C_FREE3;
            parameters[10].Value = model.C_FREE4;
            parameters[11].Value = model.D_INSERT;
            parameters[12].Value = model.C_REMARK;
            parameters[13].Value = model.N_STATUS;
            parameters[14].Value = model.C_CK;
            parameters[15].Value = model.C_MATDESC;
            parameters[16].Value = model.C_SPEC;
            parameters[17].Value = model.C_STL_GRD;
            parameters[18].Value = model.C_NC_SL;
            parameters[19].Value = model.C_NC_ZL;
            parameters[20].Value = model.C_CAP_SL;
            parameters[21].Value = model.C_CAP_ZL;
            parameters[22].Value = model.C_RF_SL;
            parameters[23].Value = model.C_RF_ZL;
            parameters[24].Value = model.C_RF_SJ_SL;
            parameters[25].Value = model.C_RF_SJ_ZL;
            parameters[26].Value = model.C_NC_CAP_SL;
            parameters[27].Value = model.C_NC_CAP_ZL;
            parameters[28].Value = model.C_RF_CAP_SL;
            parameters[29].Value = model.C_RF_CAP_ZL;
            parameters[30].Value = model.C_CAP_SJ_SL;
            parameters[31].Value = model.C_CAP_SJ_ZL;
            parameters[32].Value = model.C_ID;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }