Exemplo n.º 1
0
        /// <summary>
        /// 获取记录总数
        /// </summary>
        public int GetRecordCount(string C_NO, string C_NAME)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(1) FROM TS_CUSTFILE where 1=1");
            if (!string.IsNullOrEmpty(C_NO))
            {
                strSql.Append("and C_NO='" + C_NO + "'");
            }
            if (!string.IsNullOrEmpty(C_NAME))
            {
                strSql.Append("and C_NAME like '%" + C_NAME + "%'");
            }
            object obj = DbHelperOra.GetSingle(strSql.ToString());

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TS_CUSTADDR GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_CUST_ID,C_CGC,C_CGADDR,C_CGAREA,C_CGMAN,C_POSTCODE,C_CGMOBILE,C_CGMOBILE2,N_ISDEFAULT from TS_CUSTADDR ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TS_CUSTADDR model = new Mod_TS_CUSTADDR();
            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.º 3
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TS_CUSTOTCOMPANY GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_CUST_ID,C_OTCOMPANY,C_OPENBANK,C_ACCOUNTBANK,N_ISDEFAULT from TS_CUSTOTCOMPANY ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TS_CUSTOTCOMPANY model = new Mod_TS_CUSTOTCOMPANY();
            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.º 4
0
        /// <summary>
        /// 获取客户基本信息
        /// </summary>
        /// <param name="C_NC_M_ID">NC客商管理档案主键</param>
        /// <returns></returns>
        public Mod_TS_CUSTFILE GetCustModel(string C_NC_M_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_NC_ID,C_NC_M_ID,N_ISFLAG,C_NO,C_NAME,C_SHORNAME,C_AREATYPE,C_LEGALREPRES,C_AGENT,C_OPERATOR,C_FAX,C_TAXPAYERNO,N_LEVEL,N_STATUS,N_TYPE,C_EXTEND1,C_EXTEND2,C_EXTEND3,C_EXTEND4,C_EXTEND5,C_EMP_ID,C_EMP_NAME,D_MOD_DT,N_ISGPS,C_AREAMMAX from TS_CUSTFILE ");
            strSql.Append(" where C_NC_M_ID=:C_NC_M_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_NC_M_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_NC_M_ID;

            Mod_TS_CUSTFILE model = new Mod_TS_CUSTFILE();
            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.º 5
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TMC_CUSTGIVEMARK GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_PKHID,C_PKID,N_SCORE,D_TIME,C_REMARK from TMC_CUSTGIVEMARK ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TMC_CUSTGIVEMARK model = new Mod_TMC_CUSTGIVEMARK();
            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.º 6
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TMQ_QUALITY_STL_GRD GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_QUALITY_ID,C_MAT_TYPE,C_MAT_TYPE_N,C_STL_GRD,C_SPEC,C_BATCH_NO,C_STD_CODE,N_SHIP_WGT,N_OBJEC_WGT,N_WGT,C_REMARK,N_STATUS,N_FLAG,C_EMP_ID,C_EMP_NAME,D_MOD_DT from TMQ_QUALITY_STL_GRD ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TMQ_QUALITY_STL_GRD model = new Mod_TMQ_QUALITY_STL_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);
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TS_RoleUSER GetTokenUserRoleModel(string C_TOKEN_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_NAME,C_ACCOUNT,C_PASSWORD,C_EMAIL,C_MOBILE,N_TYPE,N_STATUS,C_DESC,D_LASTLOGINTIME,C_EMP_ID,C_EMP_NAME,D_MOD_DT,C_MOBILE2,C_PHONE,C_SHORTNAME,C_CUST_ID,C_TOKEN_ID,C_CJNAME,C_CJINTRO,C_STL_GRD,C_LEGALREPRES,C_CGJCR,C_JOB,C_JCTEL,C_ADDRESS,C_AREA,C_MANAGER from TS_USER ");
            strSql.Append(" where C_TOKEN_ID=:C_TOKEN_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_TOKEN_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_TOKEN_ID;

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

            if (ds.Tables[0].Rows.Count > 0)
            {
                model = DataRowToRoleModel(ds.Tables[0].Rows[0]);
                string sql = @"select  c_id,c_code from ts_role where c_id in (
                                   select t.c_role_id from ts_user_role t where t.c_user_id = '" + model.C_ID + "' )";
                var    dt  = DbHelperOra.Query(sql).Tables[0];
                foreach (DataRow item in dt.Rows)
                {
                    model.Roles.Add(new Mod_TS_ROLE()
                    {
                        C_ID   = item["C_ID"].ToString(),
                        C_CODE = item["c_code"].ToString()
                    });
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TQ_MODULE GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_CLASS,C_MODULE,C_CONENT,C_XGEMP,C_DEPT,C_TEL,D_TIME,C_ICT,C_RESULT,D_ICTTIME,C_REAMRK from TQ_MODULE ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2)
            };
            parameters[0].Value = C_ID;

            Mod_TQ_MODULE model = new Mod_TQ_MODULE();
            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.º 9
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TMQ_QUALITY_FILE GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_QUALITY_ID,C_TITLE,C_PATH,C_REMARK,D_DT from TMQ_QUALITY_FILE ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TMQ_QUALITY_FILE model = new Mod_TMQ_QUALITY_FILE();
            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.º 10
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TS_DIC GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_TYPECODE,C_TYPENAME,C_DETAILCODE,C_DETAILNAME,C_INDEX,N_STATUS,N_ISGPS,C_EMP_ID,C_EMP_NAME,D_MOD_DT from TS_DIC ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TS_DIC model = new Mod_TS_DIC();
            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.º 11
0
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(int pageSize, int startIndex, string classID, string empID, string start, string end, string title, string state)
        {
            StringBuilder where = new StringBuilder();


            string item = "C_ID,C_QUEST_ID,(select a.c_name from tmc_question a where a.c_id=TMC_TECH_CONSULT.c_quest_id)QUEST_NAME,C_CUST_NAME,C_CUST_CODE,C_STL_GRD,C_USE_DESC,C_REMARK,C_EMP_ID,C_EMP_NAME,D_MOD_DT,C_DEPT,C_EMP,D_PLAN_DT,D_FINISH_DT,C_REAL_TIME,C_RESULT,C_LEAVE_Q,C_REMARK2,N_CUST_EVAL,N_STATE,decode(N_STATE,0,'未处理',1,'已处理',2,'已评分',3,'办结')as N_STATE2,D_CUST_EVAL_DT,N_XG_EVAL,C_XG_EVAL_EMP,D_XG_EVAL_DT,C_ORDER_NO";

            string table = "TMC_TECH_CONSULT";
            string order = "D_MOD_DT  desc";

            if (!string.IsNullOrEmpty(empID))
            {
                where.Append(" and C_EMP_ID='" + empID + "'");
            }
            if (!string.IsNullOrEmpty(classID))
            {
                where.Append(" and C_QUEST_ID='" + classID + "'");
            }
            if (!string.IsNullOrEmpty(title))
            {
                where.Append(" and C_STL_GRD like '%" + title + "%'");
            }

            if (!string.IsNullOrEmpty(start) && !string.IsNullOrEmpty(end))
            {
                where.Append(" and D_MOD_DT between to_date('" + start + "', 'yyyy-mm-dd hh24:mi:ss') and to_date('" + Convert.ToDateTime(end).AddDays(1).ToString() + "', 'yyyy-mm-dd hh24:mi:ss')");
            }
            if (!string.IsNullOrEmpty(state))
            {
                where.Append("and N_STATE=" + state + "");
            }

            string sql = ByPage.GenerateByPageSql(pageSize, startIndex, item, table, order, where.ToString());

            return(DbHelperOra.Query(sql));
        }
Exemplo n.º 12
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TMC_TECH_CONSULT GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_QUEST_ID,C_CUST_NAME,C_CUST_CODE,C_STL_GRD,C_USE_DESC,C_REMARK,C_EMP_ID,C_EMP_NAME,D_MOD_DT,C_DEPT,C_EMP,D_PLAN_DT,D_FINISH_DT,C_REAL_TIME,C_RESULT,C_LEAVE_Q,C_REMARK2,N_CUST_EVAL,N_STATE,D_CUST_EVAL_DT,N_XG_EVAL,C_XG_EVAL_EMP,D_XG_EVAL_DT,C_ORDER_NO from TMC_TECH_CONSULT ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TMC_TECH_CONSULT model = new Mod_TMC_TECH_CONSULT();
            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.º 13
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Mod_TB_BCBZ model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TB_BCBZ(");
            strSql.Append("D_START,D_END,C_BC,C_BZ,C_EMP_ID,D_MOD_DT,C_PRO_ID)");
            strSql.Append(" values (");
            strSql.Append(":D_START,:D_END,:C_BC,:C_BZ,:C_EMP_ID,:D_MOD_DT,:C_PRO_ID)");
            OracleParameter[] parameters =
            {
                new OracleParameter(":D_START",  OracleDbType.Date),
                new OracleParameter(":D_END",    OracleDbType.Date),
                new OracleParameter(":C_BC",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_BZ",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_EMP_ID", OracleDbType.Varchar2, 100),
                new OracleParameter(":D_MOD_DT", OracleDbType.Date),
                new OracleParameter(":C_PRO_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = model.D_START;
            parameters[1].Value = model.D_END;
            parameters[2].Value = model.C_BC;
            parameters[3].Value = model.C_BZ;
            parameters[4].Value = model.C_EMP_ID;
            parameters[5].Value = model.D_MOD_DT;
            parameters[6].Value = model.C_PRO_ID;
            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TSC_SLAB_MAIN GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_PLAN_ID,C_ORD_NO,C_STOVE,C_STA_ID,C_STA_CODE,C_STA_DESC,C_STL_GRD,C_STL_GRD_PRE,C_MAT_CODE,C_MAT_NAME,C_SPEC,N_LEN,N_QUA,N_WGT,C_STD_CODE,C_SLAB_TYPE,D_CCM_DATE,C_CCM_SHIFT,C_CCM_GROUP,C_CCM_EMP_ID,C_MOVE_TYPE,C_SC_STATE,D_ESC_DATE,D_LSC_DATE,C_QKP_STATE,C_KP_ID,C_CON_NO,C_CUS_NO,C_CUS_NAME,D_WL_DATE,C_WL_SHIFT,C_WL_GROUP,C_WL_EMP_ID,D_WE_DATE,C_WE_SHIFT,C_WE_GROUP,C_WE_EMP_ID,C_STOCK_STATE,C_MAT_TYPE,C_QGP_STATE,C_SLABWH_CODE,C_SLABWH_AREA_CODE,C_SLABWH_LOC_CODE,C_SLABWH_TIER_CODE,C_Q_RESULT,D_Q_DATE,C_Q_NOTE,N_WGT_METER,C_QF_NAME,C_DESIGN_NO,C_ZRBM,C_IS_DEPOT,C_ISXM,C_XMGX,C_ISFREE from TSC_SLAB_MAIN ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TSC_SLAB_MAIN model = new Mod_TSC_SLAB_MAIN();
            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.º 15
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TS_USER GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_NAME,C_ACCOUNT,C_PASSWORD,C_EMAIL,C_MOBILE,N_TYPE,N_STATUS,C_DESC,D_LASTLOGINTIME,C_EMP_ID,C_EMP_NAME,D_MOD_DT,C_MOBILE2,C_PHONE,C_SHORTNAME,C_CUST_ID,C_TOKEN_ID,C_CJNAME,C_CJINTRO,C_STL_GRD,C_LEGALREPRES,C_CGJCR,C_JOB,C_JCTEL,C_ADDRESS,C_AREA,C_MANAGER,N_TYPE from TS_USER ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TS_USER model = new Mod_TS_USER();
            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.º 16
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TQB_STD_SPEC GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

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

            Mod_TQB_STD_SPEC model = new Mod_TQB_STD_SPEC();
            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.º 17
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TMB_NOTICE GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_CLASS,C_TITLE,C_PICURL,C_LINK,C_CONTENT,C_FILE,N_SORT,C_REMARK,N_STATUS,C_EMP_ID,C_EMP_NAME,D_MOD_DT from TMB_NOTICE ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TMB_NOTICE model = new Mod_TMB_NOTICE();
            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.º 18
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TMC_CUST_BOOK GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,D_ZF_DT,C_CUST_NAME,C_AREA,C_CUST_MANAGE,C_CUST_EMP,C_CUST_EMP_TEL,C_MEETING_CUST,C_MEETING_XG,C_MAIN_CONTENT,C_NEED_S_Q,C_LEAVE_Q,C_STL_GRD,C_PRO_USE,C_SITE,C_REMARK,N_TYPE from TMC_CUST_BOOK ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TMC_CUST_BOOK model = new Mod_TMC_CUST_BOOK();
            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.º 19
0
        public void AddExportLog(string empName)
        {
            string strSql = $"INSERT INTO TMC_TRAIN_EXPORT_LOG(C_EMPNAME)VALUES('{empName}')";

            DbHelperOra.ExecuteSql(strSql);
        }
Exemplo n.º 20
0
        /// <summary>
        /// 获取火运报备计划-发运日计划申请
        /// </summary>
        /// <param name="conno"></param>
        /// <returns></returns>
        public DataSet GetTrain(string conno, string stlgrd, string spec, string custname, string startdt, string enddt, string area)
        {
            string strSql = $@"SELECT T.C_AREA,
                               T.C_CON_NO,
                               T.C_ORDER_NO,
                               B.C_NO AS C_CUSTNO,
                               B.C_NAME AS C_CUSTNAME,
                               B.C_EXTEND1 AS C_KH_BANK,
                               B.C_TAXPAYERNO AS C_TAXNO,
                               B.C_EXTEND2 AS C_ACCOUNT,
                               B.C_EXTEND4 AS C_TEL,
                               B.C_EXTEND3 AS C_ADDRESS,
                               T.C_SPEC,
                               T.C_STL_GRD,
                               T.D_DT,
                               T.C_MAT_CODE,
                               T.C_STD_CODE,
                               T.N_WGT, --原订单量
                               TMC.N_WGT AS PLANWGT, --计划量
                               TRC.N_WGT KCWGT,
                               (SELECT A.C_NAME
                                  FROM TS_CUSTFILE A
                                 WHERE A.C_NC_M_ID = T.C_RECEIPTCORPID) AS C_DH_COMPANY
                          FROM TMO_CON_ORDER T
                          LEFT JOIN TS_CUSTFILE B
                            ON B.C_NO = T.C_CUST_NO
                          LEFT JOIN (SELECT SUM(C.N_WGT) N_WGT, C.C_BILLCODE
                                       FROM TMC_TRAIN_ITEM C
                                      WHERE C.C_FLAG = '1'
                                      GROUP BY C.C_BILLCODE) TMC
                            ON TMC.C_BILLCODE = T.C_ORDER_NO
                          LEFT JOIN (SELECT SUM(T.N_WGT) N_WGT,
                                            T.C_MAT_CODE,
                                            T.C_STD_CODE,
                                            T.C_SALE_AREA,
                                            T.C_CON_NO,
                                            T.C_CUST_NAME
                                       FROM TRC_ROLL_PRODCUT T
                                      WHERE T.C_MOVE_TYPE = 'E' AND T.C_IS_QR = 'Y'
                                      GROUP BY T.C_MAT_CODE,
                                               T.C_STD_CODE,
                                               T.C_SALE_AREA,
                                               T.C_CON_NO,
                                               T.C_CUST_NAME) TRC
                            ON TRC.C_MAT_CODE = T.C_MAT_CODE
                           AND TRC.C_STD_CODE = T.C_STD_CODE
                           AND TRC.C_SALE_AREA = T.C_AREA
                           AND SUBSTR(TRC.C_CON_NO, 0, 15) = SUBSTR(T.C_CON_NO, 0, 15)
                           AND TRC.C_CUST_NAME = T.C_CUST_NAME
                         WHERE T.N_STATUS = 2
                           AND NVL(TRC.N_WGT, 0) > 0";

            if (!string.IsNullOrEmpty(area))
            {
                strSql += $" AND T.C_AREA='{area}'";
            }
            if (!string.IsNullOrEmpty(conno))
            {
                strSql += $" AND T.C_CON_NO LIKE '%{conno}%'";
            }
            if (!string.IsNullOrEmpty(stlgrd))
            {
                strSql += $" AND T.C_STL_GRD LIKE '%{stlgrd}%'";
            }
            if (!string.IsNullOrEmpty(spec))
            {
                strSql += $" AND T.C_SPEC LIKE '%{spec}%'";
            }
            if (!string.IsNullOrEmpty(custname))
            {
                strSql += $" AND T.C_CUST_NAME LIKE '%{custname}%'";
            }

            if (!string.IsNullOrEmpty(startdt) && !string.IsNullOrEmpty(enddt))
            {
                strSql += $@" AND T.D_DT >= TO_DATE('{startdt}', 'yyyy-mm-dd hh24:mi:ss') AND T.D_DT<= to_date('{enddt} 23:59:59', 'yyyy-mm-dd hh24:mi:ss')";
            }
            return(DbHelperOra.Query(strSql));
        }
Exemplo n.º 21
0
        /// <summary>
        /// 删除计划号
        /// </summary>
        /// <param name="C_ID"></param>
        /// <returns></returns>
        public bool DelTrainPlan(string C_ID)
        {
            string strSql = $"DELETE FROM TMC_TRAIN WHERE  C_ID='{C_ID}'";

            return(DbHelperOra.ExecuteSql(strSql) > 0 ? true : false);
        }
Exemplo n.º 22
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Mod_TRC_ROLL_QTCKD_ITEM model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TRC_ROLL_QTCKD_ITEM(");
            strSql.Append("C_QTCKD_NO,C_BATCH_NO,C_JUDGE_LEV_ZH,C_MAT_CODE,C_MAT_DESC,C_STL_GRD,C_SPEC,N_NUM,N_WGT,C_Z_DW,C_F_DW,C_STOVE,C_ZYX1,C_ZYX2,C_BZYQ,C_ZYX4,N_STATUS,C_LINEWH_CODE,D_PRODUCE_DATE,C_JUDGE_LEV_BP,C_STD_CODE,N_SJNUM,N_SJWGT)");
            strSql.Append(" values (");
            strSql.Append(":C_QTCKD_NO,:C_BATCH_NO,:C_JUDGE_LEV_ZH,:C_MAT_CODE,:C_MAT_DESC,:C_STL_GRD,:C_SPEC,:N_NUM,:N_WGT,:C_Z_DW,:C_F_DW,:C_STOVE,:C_ZYX1,:C_ZYX2,:C_BZYQ,:C_ZYX4,:N_STATUS,:C_LINEWH_CODE,:D_PRODUCE_DATE,:C_JUDGE_LEV_BP,:C_STD_CODE,:N_SJNUM,:N_SJWGT)");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_QTCKD_NO",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_BATCH_NO",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_JUDGE_LEV_ZH", OracleDbType.Varchar2, 100),
                new OracleParameter(":C_MAT_CODE",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_MAT_DESC",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STL_GRD",      OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SPEC",         OracleDbType.Varchar2, 100),
                new OracleParameter(":N_NUM",          OracleDbType.Int16,     15),
                new OracleParameter(":N_WGT",          OracleDbType.Int16,     15),
                new OracleParameter(":C_Z_DW",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_F_DW",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STOVE",        OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ZYX1",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ZYX2",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_BZYQ",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ZYX4",         OracleDbType.Varchar2, 100),
                new OracleParameter(":N_STATUS",       OracleDbType.Int16,      1),
                new OracleParameter(":C_LINEWH_CODE",  OracleDbType.Varchar2, 100),
                new OracleParameter(":D_PRODUCE_DATE", OracleDbType.Date),
                new OracleParameter(":C_JUDGE_LEV_BP", OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STD_CODE",     OracleDbType.Varchar2, 100),
                new OracleParameter(":N_SJNUM",        OracleDbType.Int16,     15),
                new OracleParameter(":N_SJWGT",        OracleDbType.Int16, 15)
            };
            parameters[0].Value  = model.C_QTCKD_NO;
            parameters[1].Value  = model.C_BATCH_NO;
            parameters[2].Value  = model.C_JUDGE_LEV_ZH;
            parameters[3].Value  = model.C_MAT_CODE;
            parameters[4].Value  = model.C_MAT_DESC;
            parameters[5].Value  = model.C_STL_GRD;
            parameters[6].Value  = model.C_SPEC;
            parameters[7].Value  = model.N_NUM;
            parameters[8].Value  = model.N_WGT;
            parameters[9].Value  = model.C_Z_DW;
            parameters[10].Value = model.C_F_DW;
            parameters[11].Value = model.C_STOVE;
            parameters[12].Value = model.C_ZYX1;
            parameters[13].Value = model.C_ZYX2;
            parameters[14].Value = model.C_BZYQ;
            parameters[15].Value = model.C_ZYX4;
            parameters[16].Value = model.N_STATUS;
            parameters[17].Value = model.C_LINEWH_CODE;
            parameters[18].Value = model.D_PRODUCE_DATE;
            parameters[19].Value = model.C_JUDGE_LEV_BP;
            parameters[20].Value = model.C_STD_CODE;
            parameters[21].Value = model.N_SJNUM;
            parameters[22].Value = model.N_SJWGT;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 23
0
        /// <summary>
        /// 删除火运计划
        /// </summary>
        /// <param name="mod"></param>
        /// <returns></returns>
        public bool Del(Mod_TMC_TRAIN_ITEM mod)
        {
            string strSql = $"DELETE FROM TMC_TRAIN_ITEM WHERE C_ID='{mod.C_ID}'";

            return(DbHelperOra.ExecuteSql(strSql) > 0 ? true : false);
        }
Exemplo n.º 24
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Mod_TMQ_QUALITY_MAIN model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TMQ_QUALITY_MAIN(");
            strSql.Append("C_ID,C_QUEST_ID,C_PROD_KIND_ID,C_SHIPVIA,D_SHIP_START_DT,D_SHIP_END_DT,N_PARENT_REMAIN_WGT,N_MIDDLE_REMAIN_WGT,C_AREA,C_CUST_NAME,C_CUST_TYPE,C_CUST_NO,C_TEL,C_NAME,C_STL_GRD_CLASS,C_PROD_USE,N_OBJECT_COUNT_WGT,C_OBJECT_CONTENT,C_TECH_DESC,C_SITE_SURVEY_CONTENT,N_PARENT_QUA,N_QUEST_QUA,N_MIDDLE_QUA,N_ELSE_QUA,C_SITE_SURVEY_EMP,C_DEPT,C_REMARK,C_CUST_MAKING,C_CUST_MAKING_DT,C_XG_MODIFY,C_XG_MODEIFY_DT,C_APPROVER,D_APPROVER_DT,C_FLOW_ID,N_STATUS,N_FLAG,C_EMP_ID,C_EMP_NAME,D_MOD_DT,C_DEPT2,C_DEPT3,C_DEPT4)");
            strSql.Append(" values (");
            strSql.Append(":C_ID,:C_QUEST_ID,:C_PROD_KIND_ID,:C_SHIPVIA,:D_SHIP_START_DT,:D_SHIP_END_DT,:N_PARENT_REMAIN_WGT,:N_MIDDLE_REMAIN_WGT,:C_AREA,:C_CUST_NAME,:C_CUST_TYPE,:C_CUST_NO,:C_TEL,:C_NAME,:C_STL_GRD_CLASS,:C_PROD_USE,:N_OBJECT_COUNT_WGT,:C_OBJECT_CONTENT,:C_TECH_DESC,:C_SITE_SURVEY_CONTENT,:N_PARENT_QUA,:N_QUEST_QUA,:N_MIDDLE_QUA,:N_ELSE_QUA,:C_SITE_SURVEY_EMP,:C_DEPT,:C_REMARK,:C_CUST_MAKING,:C_CUST_MAKING_DT,:C_XG_MODIFY,:C_XG_MODEIFY_DT,:C_APPROVER,:D_APPROVER_DT,:C_FLOW_ID,:N_STATUS,:N_FLAG,:C_EMP_ID,:C_EMP_NAME,:D_MOD_DT,:C_DEPT2,:C_DEPT3,:C_DEPT4)");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID",                  OracleDbType.Varchar2, 100),
                new OracleParameter(":C_QUEST_ID",            OracleDbType.Varchar2, 100),
                new OracleParameter(":C_PROD_KIND_ID",        OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SHIPVIA",             OracleDbType.Varchar2, 100),
                new OracleParameter(":D_SHIP_START_DT",       OracleDbType.Date),
                new OracleParameter(":D_SHIP_END_DT",         OracleDbType.Date),
                new OracleParameter(":N_PARENT_REMAIN_WGT",   OracleDbType.Decimal,   15),
                new OracleParameter(":N_MIDDLE_REMAIN_WGT",   OracleDbType.Decimal,   15),
                new OracleParameter(":C_AREA",                OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CUST_NAME",           OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CUST_TYPE",           OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CUST_NO",             OracleDbType.Varchar2, 100),
                new OracleParameter(":C_TEL",                 OracleDbType.Varchar2,  20),
                new OracleParameter(":C_NAME",                OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STL_GRD_CLASS",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_PROD_USE",            OracleDbType.Varchar2, 100),
                new OracleParameter(":N_OBJECT_COUNT_WGT",    OracleDbType.Decimal,   15),
                new OracleParameter(":C_OBJECT_CONTENT",      OracleDbType.Varchar2, 200),
                new OracleParameter(":C_TECH_DESC",           OracleDbType.Varchar2, 200),
                new OracleParameter(":C_SITE_SURVEY_CONTENT", OracleDbType.Varchar2, 200),
                new OracleParameter(":N_PARENT_QUA",          OracleDbType.Decimal,    2),
                new OracleParameter(":N_QUEST_QUA",           OracleDbType.Decimal,    2),
                new OracleParameter(":N_MIDDLE_QUA",          OracleDbType.Decimal,    2),
                new OracleParameter(":N_ELSE_QUA",            OracleDbType.Decimal,    2),
                new OracleParameter(":C_SITE_SURVEY_EMP",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_DEPT",                OracleDbType.Varchar2, 100),
                new OracleParameter(":C_REMARK",              OracleDbType.Varchar2, 200),
                new OracleParameter(":C_CUST_MAKING",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CUST_MAKING_DT",      OracleDbType.Date),
                new OracleParameter(":C_XG_MODIFY",           OracleDbType.Varchar2, 100),
                new OracleParameter(":C_XG_MODEIFY_DT",       OracleDbType.Date),
                new OracleParameter(":C_APPROVER",            OracleDbType.Varchar2, 100),
                new OracleParameter(":D_APPROVER_DT",         OracleDbType.Date),
                new OracleParameter(":C_FLOW_ID",             OracleDbType.Varchar2, 100),
                new OracleParameter(":N_STATUS",              OracleDbType.Decimal,    1),
                new OracleParameter(":N_FLAG",                OracleDbType.Decimal,    1),
                new OracleParameter(":C_EMP_ID",              OracleDbType.Varchar2, 100),
                new OracleParameter(":C_EMP_NAME",            OracleDbType.Varchar2,  20),
                new OracleParameter(":D_MOD_DT",              OracleDbType.Date),
                new OracleParameter(":C_DEPT2",               OracleDbType.Varchar2, 100),
                new OracleParameter(":C_DEPT3",               OracleDbType.Varchar2, 100),
                new OracleParameter(":C_DEPT4",               OracleDbType.Varchar2, 100)
            };
            parameters[0].Value  = model.C_ID;
            parameters[1].Value  = model.C_QUEST_ID;
            parameters[2].Value  = model.C_PROD_KIND_ID;
            parameters[3].Value  = model.C_SHIPVIA;
            parameters[4].Value  = model.D_SHIP_START_DT;
            parameters[5].Value  = model.D_SHIP_END_DT;
            parameters[6].Value  = model.N_PARENT_REMAIN_WGT;
            parameters[7].Value  = model.N_MIDDLE_REMAIN_WGT;
            parameters[8].Value  = model.C_AREA;
            parameters[9].Value  = model.C_CUST_NAME;
            parameters[10].Value = model.C_CUST_TYPE;
            parameters[11].Value = model.C_CUST_NO;
            parameters[12].Value = model.C_TEL;
            parameters[13].Value = model.C_NAME;
            parameters[14].Value = model.C_STL_GRD_CLASS;
            parameters[15].Value = model.C_PROD_USE;
            parameters[16].Value = model.N_OBJECT_COUNT_WGT;
            parameters[17].Value = model.C_OBJECT_CONTENT;
            parameters[18].Value = model.C_TECH_DESC;
            parameters[19].Value = model.C_SITE_SURVEY_CONTENT;
            parameters[20].Value = model.N_PARENT_QUA;
            parameters[21].Value = model.N_QUEST_QUA;
            parameters[22].Value = model.N_MIDDLE_QUA;
            parameters[23].Value = model.N_ELSE_QUA;
            parameters[24].Value = model.C_SITE_SURVEY_EMP;
            parameters[25].Value = model.C_DEPT;
            parameters[26].Value = model.C_REMARK;
            parameters[27].Value = model.C_CUST_MAKING;
            parameters[28].Value = model.C_CUST_MAKING_DT;
            parameters[29].Value = model.C_XG_MODIFY;
            parameters[30].Value = model.C_XG_MODEIFY_DT;
            parameters[31].Value = model.C_APPROVER;
            parameters[32].Value = model.D_APPROVER_DT;
            parameters[33].Value = model.C_FLOW_ID;
            parameters[34].Value = model.N_STATUS;
            parameters[35].Value = model.N_FLAG;
            parameters[36].Value = model.C_EMP_ID;
            parameters[37].Value = model.C_EMP_NAME;
            parameters[38].Value = model.D_MOD_DT;
            parameters[39].Value = model.C_DEPT2;
            parameters[40].Value = model.C_DEPT3;
            parameters[41].Value = model.C_DEPT4;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Mod_TRC_ROLL_QTCKD_ITEM model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TRC_ROLL_QTCKD_ITEM set ");
            strSql.Append("C_QTCKD_NO=:C_QTCKD_NO,");
            strSql.Append("C_BATCH_NO=:C_BATCH_NO,");
            strSql.Append("C_JUDGE_LEV_ZH=:C_JUDGE_LEV_ZH,");
            strSql.Append("C_MAT_CODE=:C_MAT_CODE,");
            strSql.Append("C_MAT_DESC=:C_MAT_DESC,");
            strSql.Append("C_STL_GRD=:C_STL_GRD,");
            strSql.Append("C_SPEC=:C_SPEC,");
            strSql.Append("N_NUM=:N_NUM,");
            strSql.Append("N_WGT=:N_WGT,");
            strSql.Append("C_Z_DW=:C_Z_DW,");
            strSql.Append("C_F_DW=:C_F_DW,");
            strSql.Append("C_STOVE=:C_STOVE,");
            strSql.Append("C_ZYX1=:C_ZYX1,");
            strSql.Append("C_ZYX2=:C_ZYX2,");
            strSql.Append("C_BZYQ=:C_BZYQ,");
            strSql.Append("C_ZYX4=:C_ZYX4,");
            strSql.Append("N_STATUS=:N_STATUS,");
            strSql.Append("C_LINEWH_CODE=:C_LINEWH_CODE,");
            strSql.Append("D_PRODUCE_DATE=:D_PRODUCE_DATE,");
            strSql.Append("C_JUDGE_LEV_BP=:C_JUDGE_LEV_BP,");
            strSql.Append("C_STD_CODE=:C_STD_CODE,");
            strSql.Append("N_SJNUM=:N_SJNUM,");
            strSql.Append("N_SJWGT=:N_SJWGT");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_QTCKD_NO",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_BATCH_NO",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_JUDGE_LEV_ZH", OracleDbType.Varchar2, 100),
                new OracleParameter(":C_MAT_CODE",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_MAT_DESC",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STL_GRD",      OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SPEC",         OracleDbType.Varchar2, 100),
                new OracleParameter(":N_NUM",          OracleDbType.Int16,     15),
                new OracleParameter(":N_WGT",          OracleDbType.Int16,     15),
                new OracleParameter(":C_Z_DW",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_F_DW",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STOVE",        OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ZYX1",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ZYX2",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_BZYQ",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ZYX4",         OracleDbType.Varchar2, 100),
                new OracleParameter(":N_STATUS",       OracleDbType.Int16,      1),
                new OracleParameter(":C_LINEWH_CODE",  OracleDbType.Varchar2, 100),
                new OracleParameter(":D_PRODUCE_DATE", OracleDbType.Date),
                new OracleParameter(":C_JUDGE_LEV_BP", OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STD_CODE",     OracleDbType.Varchar2, 100),
                new OracleParameter(":N_SJNUM",        OracleDbType.Int16,     15),
                new OracleParameter(":N_SJWGT",        OracleDbType.Int16,     15),
                new OracleParameter(":C_ID",           OracleDbType.Varchar2, 100)
            };
            parameters[0].Value  = model.C_QTCKD_NO;
            parameters[1].Value  = model.C_BATCH_NO;
            parameters[2].Value  = model.C_JUDGE_LEV_ZH;
            parameters[3].Value  = model.C_MAT_CODE;
            parameters[4].Value  = model.C_MAT_DESC;
            parameters[5].Value  = model.C_STL_GRD;
            parameters[6].Value  = model.C_SPEC;
            parameters[7].Value  = model.N_NUM;
            parameters[8].Value  = model.N_WGT;
            parameters[9].Value  = model.C_Z_DW;
            parameters[10].Value = model.C_F_DW;
            parameters[11].Value = model.C_STOVE;
            parameters[12].Value = model.C_ZYX1;
            parameters[13].Value = model.C_ZYX2;
            parameters[14].Value = model.C_BZYQ;
            parameters[15].Value = model.C_ZYX4;
            parameters[16].Value = model.N_STATUS;
            parameters[17].Value = model.C_LINEWH_CODE;
            parameters[18].Value = model.D_PRODUCE_DATE;
            parameters[19].Value = model.C_JUDGE_LEV_BP;
            parameters[20].Value = model.C_STD_CODE;
            parameters[21].Value = model.N_SJNUM;
            parameters[22].Value = model.N_SJWGT;
            parameters[23].Value = model.C_ID;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 26
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Mod_TMQ_QUALITY_MAIN model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TMQ_QUALITY_MAIN set ");
            strSql.Append("C_QUEST_ID=:C_QUEST_ID,");
            strSql.Append("C_PROD_KIND_ID=:C_PROD_KIND_ID,");
            strSql.Append("C_SHIPVIA=:C_SHIPVIA,");
            strSql.Append("D_SHIP_START_DT=:D_SHIP_START_DT,");
            strSql.Append("D_SHIP_END_DT=:D_SHIP_END_DT,");
            strSql.Append("N_PARENT_REMAIN_WGT=:N_PARENT_REMAIN_WGT,");
            strSql.Append("N_MIDDLE_REMAIN_WGT=:N_MIDDLE_REMAIN_WGT,");
            strSql.Append("C_AREA=:C_AREA,");
            strSql.Append("C_CUST_NAME=:C_CUST_NAME,");
            strSql.Append("C_CUST_TYPE=:C_CUST_TYPE,");
            strSql.Append("C_CUST_NO=:C_CUST_NO,");
            strSql.Append("C_TEL=:C_TEL,");
            strSql.Append("C_NAME=:C_NAME,");
            strSql.Append("C_STL_GRD_CLASS=:C_STL_GRD_CLASS,");
            strSql.Append("C_PROD_USE=:C_PROD_USE,");
            strSql.Append("N_OBJECT_COUNT_WGT=:N_OBJECT_COUNT_WGT,");
            strSql.Append("C_OBJECT_CONTENT=:C_OBJECT_CONTENT,");
            strSql.Append("C_TECH_DESC=:C_TECH_DESC,");
            strSql.Append("C_SITE_SURVEY_CONTENT=:C_SITE_SURVEY_CONTENT,");
            strSql.Append("N_PARENT_QUA=:N_PARENT_QUA,");
            strSql.Append("N_QUEST_QUA=:N_QUEST_QUA,");
            strSql.Append("N_MIDDLE_QUA=:N_MIDDLE_QUA,");
            strSql.Append("N_ELSE_QUA=:N_ELSE_QUA,");
            strSql.Append("C_SITE_SURVEY_EMP=:C_SITE_SURVEY_EMP,");
            strSql.Append("C_DEPT=:C_DEPT,");
            strSql.Append("C_REMARK=:C_REMARK,");
            strSql.Append("C_CUST_MAKING=:C_CUST_MAKING,");
            strSql.Append("C_CUST_MAKING_DT=:C_CUST_MAKING_DT,");
            strSql.Append("C_XG_MODIFY=:C_XG_MODIFY,");
            strSql.Append("C_XG_MODEIFY_DT=:C_XG_MODEIFY_DT,");
            strSql.Append("C_APPROVER=:C_APPROVER,");
            strSql.Append("D_APPROVER_DT=:D_APPROVER_DT,");
            strSql.Append("C_FLOW_ID=:C_FLOW_ID,");
            strSql.Append("N_STATUS=:N_STATUS,");
            strSql.Append("N_FLAG=:N_FLAG,");
            strSql.Append("C_EMP_ID=:C_EMP_ID,");
            strSql.Append("C_EMP_NAME=:C_EMP_NAME,");
            strSql.Append("D_MOD_DT=:D_MOD_DT,");
            strSql.Append("C_DEPT2=:C_DEPT2,");
            strSql.Append("C_DEPT3=:C_DEPT3,");
            strSql.Append("C_DEPT4=:C_DEPT4");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_QUEST_ID",            OracleDbType.Varchar2, 100),
                new OracleParameter(":C_PROD_KIND_ID",        OracleDbType.Varchar2, 100),
                new OracleParameter(":C_SHIPVIA",             OracleDbType.Varchar2, 100),
                new OracleParameter(":D_SHIP_START_DT",       OracleDbType.Date),
                new OracleParameter(":D_SHIP_END_DT",         OracleDbType.Date),
                new OracleParameter(":N_PARENT_REMAIN_WGT",   OracleDbType.Decimal,   15),
                new OracleParameter(":N_MIDDLE_REMAIN_WGT",   OracleDbType.Decimal,   15),
                new OracleParameter(":C_AREA",                OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CUST_NAME",           OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CUST_TYPE",           OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CUST_NO",             OracleDbType.Varchar2, 100),
                new OracleParameter(":C_TEL",                 OracleDbType.Varchar2,  20),
                new OracleParameter(":C_NAME",                OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STL_GRD_CLASS",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_PROD_USE",            OracleDbType.Varchar2, 100),
                new OracleParameter(":N_OBJECT_COUNT_WGT",    OracleDbType.Decimal,   15),
                new OracleParameter(":C_OBJECT_CONTENT",      OracleDbType.Varchar2, 200),
                new OracleParameter(":C_TECH_DESC",           OracleDbType.Varchar2, 200),
                new OracleParameter(":C_SITE_SURVEY_CONTENT", OracleDbType.Varchar2, 200),
                new OracleParameter(":N_PARENT_QUA",          OracleDbType.Decimal,    2),
                new OracleParameter(":N_QUEST_QUA",           OracleDbType.Decimal,    2),
                new OracleParameter(":N_MIDDLE_QUA",          OracleDbType.Decimal,    2),
                new OracleParameter(":N_ELSE_QUA",            OracleDbType.Decimal,    2),
                new OracleParameter(":C_SITE_SURVEY_EMP",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_DEPT",                OracleDbType.Varchar2, 100),
                new OracleParameter(":C_REMARK",              OracleDbType.Varchar2, 200),
                new OracleParameter(":C_CUST_MAKING",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CUST_MAKING_DT",      OracleDbType.Date),
                new OracleParameter(":C_XG_MODIFY",           OracleDbType.Varchar2, 100),
                new OracleParameter(":C_XG_MODEIFY_DT",       OracleDbType.Date),
                new OracleParameter(":C_APPROVER",            OracleDbType.Varchar2, 100),
                new OracleParameter(":D_APPROVER_DT",         OracleDbType.Date),
                new OracleParameter(":C_FLOW_ID",             OracleDbType.Varchar2, 100),
                new OracleParameter(":N_STATUS",              OracleDbType.Decimal,    1),
                new OracleParameter(":N_FLAG",                OracleDbType.Decimal,    1),
                new OracleParameter(":C_EMP_ID",              OracleDbType.Varchar2, 100),
                new OracleParameter(":C_EMP_NAME",            OracleDbType.Varchar2,  20),
                new OracleParameter(":D_MOD_DT",              OracleDbType.Date),
                new OracleParameter(":C_DEPT2",               OracleDbType.Varchar2, 100),
                new OracleParameter(":C_DEPT3",               OracleDbType.Varchar2, 100),
                new OracleParameter(":C_DEPT4",               OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ID",                  OracleDbType.Varchar2, 100)
            };
            parameters[0].Value  = model.C_QUEST_ID;
            parameters[1].Value  = model.C_PROD_KIND_ID;
            parameters[2].Value  = model.C_SHIPVIA;
            parameters[3].Value  = model.D_SHIP_START_DT;
            parameters[4].Value  = model.D_SHIP_END_DT;
            parameters[5].Value  = model.N_PARENT_REMAIN_WGT;
            parameters[6].Value  = model.N_MIDDLE_REMAIN_WGT;
            parameters[7].Value  = model.C_AREA;
            parameters[8].Value  = model.C_CUST_NAME;
            parameters[9].Value  = model.C_CUST_TYPE;
            parameters[10].Value = model.C_CUST_NO;
            parameters[11].Value = model.C_TEL;
            parameters[12].Value = model.C_NAME;
            parameters[13].Value = model.C_STL_GRD_CLASS;
            parameters[14].Value = model.C_PROD_USE;
            parameters[15].Value = model.N_OBJECT_COUNT_WGT;
            parameters[16].Value = model.C_OBJECT_CONTENT;
            parameters[17].Value = model.C_TECH_DESC;
            parameters[18].Value = model.C_SITE_SURVEY_CONTENT;
            parameters[19].Value = model.N_PARENT_QUA;
            parameters[20].Value = model.N_QUEST_QUA;
            parameters[21].Value = model.N_MIDDLE_QUA;
            parameters[22].Value = model.N_ELSE_QUA;
            parameters[23].Value = model.C_SITE_SURVEY_EMP;
            parameters[24].Value = model.C_DEPT;
            parameters[25].Value = model.C_REMARK;
            parameters[26].Value = model.C_CUST_MAKING;
            parameters[27].Value = model.C_CUST_MAKING_DT;
            parameters[28].Value = model.C_XG_MODIFY;
            parameters[29].Value = model.C_XG_MODEIFY_DT;
            parameters[30].Value = model.C_APPROVER;
            parameters[31].Value = model.D_APPROVER_DT;
            parameters[32].Value = model.C_FLOW_ID;
            parameters[33].Value = model.N_STATUS;
            parameters[34].Value = model.N_FLAG;
            parameters[35].Value = model.C_EMP_ID;
            parameters[36].Value = model.C_EMP_NAME;
            parameters[37].Value = model.D_MOD_DT;
            parameters[38].Value = model.C_DEPT2;
            parameters[39].Value = model.C_DEPT3;
            parameters[40].Value = model.C_DEPT4;
            parameters[41].Value = model.C_ID;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 27
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Mod_TB_STA model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TB_STA set ");
            strSql.Append("C_PRO_ID=:C_PRO_ID,");
            strSql.Append("C_STA_CODE=:C_STA_CODE,");
            strSql.Append("C_STA_DESC=:C_STA_DESC,");
            strSql.Append("C_EMP_ID=:C_EMP_ID,");
            strSql.Append("D_MOD_DT=:D_MOD_DT,");
            strSql.Append("C_REMARK=:C_REMARK,");
            strSql.Append("D_START_DATE=:D_START_DATE,");
            strSql.Append("D_END_DATE=:D_END_DATE,");
            strSql.Append("N_STATUS=:N_STATUS,");
            strSql.Append("C_STA_ERPCODE=:C_STA_ERPCODE,");
            strSql.Append("C_STA_MESCODE=:C_STA_MESCODE,");
            strSql.Append("N_SORT=:N_SORT,");
            strSql.Append("C_ERP_PK=:C_ERP_PK");
            strSql.Append(" WHERE C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_PRO_ID",      OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STA_CODE",    OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STA_DESC",    OracleDbType.Varchar2, 100),
                new OracleParameter(":C_EMP_ID",      OracleDbType.Varchar2, 100),
                new OracleParameter(":D_MOD_DT",      OracleDbType.Date),
                new OracleParameter(":C_REMARK",      OracleDbType.Varchar2, 200),
                new OracleParameter(":D_START_DATE",  OracleDbType.Date),
                new OracleParameter(":D_END_DATE",    OracleDbType.Date),
                new OracleParameter(":N_STATUS",      OracleDbType.Decimal,    1),
                new OracleParameter(":C_STA_ERPCODE", OracleDbType.Varchar2, 100),
                new OracleParameter(":C_STA_MESCODE", OracleDbType.Varchar2, 100),
                new OracleParameter(":N_SORT",        OracleDbType.Decimal,    3),
                new OracleParameter(":C_ERP_PK",      OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ID",          OracleDbType.Varchar2, 100)
            };
            parameters[0].Value  = model.C_PRO_ID;
            parameters[1].Value  = model.C_STA_CODE;
            parameters[2].Value  = model.C_STA_DESC;
            parameters[3].Value  = model.C_EMP_ID;
            parameters[4].Value  = model.D_MOD_DT;
            parameters[5].Value  = model.C_REMARK;
            parameters[6].Value  = model.D_START_DATE;
            parameters[7].Value  = model.D_END_DATE;
            parameters[8].Value  = model.N_STATUS;
            parameters[9].Value  = model.C_STA_ERPCODE;
            parameters[10].Value = model.C_STA_MESCODE;
            parameters[11].Value = model.N_SORT;
            parameters[12].Value = model.C_ERP_PK;
            parameters[13].Value = model.C_ID;

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

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 28
0
        /// <summary>
        /// 添加火运日计划单据号
        /// </summary>
        /// <param name="mod"></param>
        /// <returns></returns>
        public bool Insert(Mod_TMC_TRAIN_MAIN mod)
        {
            string strSql = $@"INSERT INTO TMC_TRAIN_MAIN(C_ID,C_EMPID,C_EMPNAME,C_SHIPVIA)VALUES('{mod.C_ID}','{mod.C_EMPID}','{mod.C_EMPNAME}','火运代垫(销售)')";

            return(DbHelperOra.ExecuteSql(strSql) > 0 ? true : false);
        }
Exemplo n.º 29
0
        /// <summary>
        /// 火运/汽运审核
        /// </summary>
        /// <param name="fyd">发运单</param>
        /// <param name="emp">制单人</param>
        /// <param name="conno">合同号</param>
        /// <param name="cust">客户</param>
        /// <param name="stlgrd">钢种</param>
        /// <param name="spec">规格</param>
        /// <param name="ischeck">是否审核</param>
        /// <param name="flag">是否监控</param>
        /// <param name="startDT">提报开始时间</param>
        /// <param name="endDT">提报截至时间</param>
        /// <returns></returns>
        public DataSet GetTrainMain(string fyd, string emp, string conno, string cust, string stlgrd, string spec, string ischeck, string flag, string startDT, string endDT, string fyfs, string station, string area, string xfwgt)
        {
            string strSql = $@"SELECT T.C_ID,
                               T.C_STATION,
                               T.C_SHIPVIA,
                               T.D_DT,
                               T.D_CHECKTIME,
                               T.C_CHECKEMP,
                               T.C_EMPNAME,
                               T.C_ISCHECK,
                               A.C_AREA,
                               A.C_CONNO,
                               A.C_DH_COMPANY,
                               A.C_STL_GRD,
                               A.C_SPEC,
                               A.N_WGT,
                               NVL(B.C_FLAG, 'N') C_FLAG,
                               A.C_ID AS  C_ID2
                          FROM TMC_TRAIN_MAIN T
                         INNER JOIN TMC_TRAIN_ITEM A
                            ON A.C_PKID = T.C_ID
                          LEFT JOIN TMB_MONI_STLGRD B
                            ON B.C_STL_GRD = A.C_STL_GRD WHERE T.C_ISCHECK='{ischeck}'";

            if (!string.IsNullOrEmpty(fyd))
            {
                strSql += $" AND T.C_ID = '{fyd}'";
            }
            if (!string.IsNullOrEmpty(emp))
            {
                strSql += $" AND T.C_EMPNAME = '{emp}'";
            }
            if (!string.IsNullOrEmpty(conno))
            {
                strSql += $" AND A.C_CONNO = '{conno}'";
            }
            if (!string.IsNullOrEmpty(cust))
            {
                strSql += $" AND A.C_DH_COMPANY='{cust}'";
            }
            if (!string.IsNullOrEmpty(stlgrd))
            {
                strSql += $" AND A.C_STL_GRD='{stlgrd}'";
            }
            if (!string.IsNullOrEmpty(spec))
            {
                strSql += $" AND A.C_SPEC LIKE '%{spec}%'";
            }
            if (!string.IsNullOrEmpty(flag))
            {
                strSql += $" AND B.C_FLAG='{flag}'";
            }
            if (!string.IsNullOrEmpty(startDT) && !string.IsNullOrEmpty(endDT))
            {
                strSql += $@" AND T.D_DT BETWEEN TO_DATE('{startDT}', 'yyyy-mm-dd hh24:mi:ss') AND to_date('{endDT} 23:59:59', 'yyyy-mm-dd hh24:mi:ss')";
            }
            if (!string.IsNullOrEmpty(fyfs))
            {
                strSql += $" AND T.C_SHIPVIA='{fyfs}'";
            }
            if (!string.IsNullOrEmpty(station))
            {
                strSql += $" AND T.C_STATION LIKE '%{station}%'";
            }
            if (!string.IsNullOrEmpty(area))
            {
                strSql += $" AND A.C_AREA = '{area}'";
            }



            if (!string.IsNullOrEmpty(xfwgt))
            {
                DataView dv = DbHelperOra.Query(strSql).Tables[0].DefaultView;
                dv.Sort = "N_WGT ASC";
                DataTable dt     = dv.ToTable();
                string    listID = "";
                var       list   = new List <string>();

                decimal wgt = 0;
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    wgt = wgt + Convert.ToDecimal(dt.Rows[i]["N_WGT"]);
                    list.Add(dt.Rows[i]["C_ID2"].ToString());

                    if (wgt >= Convert.ToDecimal(xfwgt))
                    {
                        break;
                    }
                }
                listID = "'" + string.Join("','", list.ToArray()) + "'";

                if (!string.IsNullOrEmpty(listID))
                {
                    strSql += $" AND A.C_ID IN({listID})";
                }



                return(DbHelperOra.Query(strSql));
            }
            else
            {
                return(DbHelperOra.Query(strSql));
            }
        }
Exemplo n.º 30
0
        /// <summary>
        /// 获取火运计划子表数据
        /// </summary>
        /// <param name="pkID"></param>
        /// <returns></returns>
        public DataSet GetList(string pkID)
        {
            string strSql = $"SELECT * FROM TMC_TRAIN_ITEM T WHERE T.C_PKID='{pkID}'";

            return(DbHelperOra.Query(strSql));
        }