コード例 #1
0
        public virtual OrdersLogInfo GetOrdersLogByID(int ID)
        {
            OrdersLogInfo entity  = null;
            SqlDataReader RdrList = null;

            try {
                string SqlList;
                SqlList = "SELECT * FROM Orders_Log WHERE Orders_Log_ID = " + ID;
                RdrList = DBHelper.ExecuteReader(SqlList);
                if (RdrList.Read())
                {
                    entity = new OrdersLogInfo();
                    entity.Orders_Log_ID       = Tools.NullInt(RdrList["Orders_Log_ID"]);
                    entity.Orders_Log_OrdersID = Tools.NullInt(RdrList["Orders_Log_OrdersID"]);
                    entity.Orders_Log_Addtime  = Tools.NullDate(RdrList["Orders_Log_Addtime"]);
                    entity.Orders_Log_Operator = Tools.NullStr(RdrList["Orders_Log_Operator"]);
                    entity.Orders_Log_Remark   = Tools.NullStr(RdrList["Orders_Log_Remark"]);
                    entity.Orders_Log_Action   = Tools.NullStr(RdrList["Orders_Log_Action"]);
                    entity.Orders_Log_Result   = Tools.NullStr(RdrList["Orders_Log_Result"]);
                }
                return(entity);
            }
            catch (Exception ex) {
                throw ex;
            }
            finally {
                if (RdrList != null)
                {
                    RdrList.Close();
                    RdrList = null;
                }
            }
        }
コード例 #2
0
        public virtual bool EditOrdersLog(OrdersLogInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

            SqlAdd = "SELECT * FROM Orders_Log WHERE Orders_Log_ID = " + entity.Orders_Log_ID;
            DtAdd  = DBHelper.Query(SqlAdd);
            try {
                if (DtAdd.Rows.Count > 0)
                {
                    DrAdd = DtAdd.Rows[0];
                    DrAdd["Orders_Log_ID"]       = entity.Orders_Log_ID;
                    DrAdd["Orders_Log_OrdersID"] = entity.Orders_Log_OrdersID;
                    DrAdd["Orders_Log_Addtime"]  = entity.Orders_Log_Addtime;
                    DrAdd["Orders_Log_Operator"] = entity.Orders_Log_Operator;
                    DrAdd["Orders_Log_Remark"]   = entity.Orders_Log_Remark;
                    DrAdd["Orders_Log_Action"]   = entity.Orders_Log_Action;
                    DrAdd["Orders_Log_Result"]   = entity.Orders_Log_Result;
                    DBHelper.SaveChanges(SqlAdd, DtAdd);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex) {
                throw ex;
            }
            finally {
                DtAdd.Dispose();
            }
            return(true);
        }
コード例 #3
0
        public virtual bool AddOrdersLog(OrdersLogInfo entity)
        {
            string    SqlAdd = null;
            DataTable DtAdd  = null;
            DataRow   DrAdd  = null;

            SqlAdd = "SELECT TOP 0 * FROM Orders_Log";
            DtAdd  = DBHelper.Query(SqlAdd);
            DrAdd  = DtAdd.NewRow();
            DrAdd["Orders_Log_ID"]       = entity.Orders_Log_ID;
            DrAdd["Orders_Log_OrdersID"] = entity.Orders_Log_OrdersID;
            DrAdd["Orders_Log_Addtime"]  = entity.Orders_Log_Addtime;
            DrAdd["Orders_Log_Operator"] = entity.Orders_Log_Operator;
            DrAdd["Orders_Log_Remark"]   = entity.Orders_Log_Remark;
            DrAdd["Orders_Log_Action"]   = entity.Orders_Log_Action;
            DrAdd["Orders_Log_Result"]   = entity.Orders_Log_Result;
            DtAdd.Rows.Add(DrAdd);
            try {
                DBHelper.SaveChanges(SqlAdd, DtAdd);
                return(true);
            }
            catch (Exception ex) {
                throw ex;
            }
            finally {
                DtAdd.Dispose();
            }
        }
コード例 #4
0
ファイル: Orders.cs プロジェクト: Abnertd/public
    public void Orders_Log(int orders_id, string log_operator, string log_action, string log_result, string log_remark)
    {
        OrdersLogInfo orderslog = new OrdersLogInfo();

        orderslog.Orders_Log_ID       = 0;
        orderslog.Orders_Log_Operator = log_operator;
        orderslog.Orders_Log_OrdersID = orders_id;
        orderslog.Orders_Log_Action   = log_action;
        orderslog.Orders_Log_Remark   = log_remark;
        orderslog.Orders_Log_Result   = log_result;
        orderslog.Orders_Log_Addtime  = DateTime.Now;
        Mylog.AddOrdersLog(orderslog);
    }
コード例 #5
0
 public virtual bool EditOrdersLog(OrdersLogInfo entity)
 {
     return(MyDAL.EditOrdersLog(entity));
 }
コード例 #6
0
 public virtual bool AddOrdersLog(OrdersLogInfo entity)
 {
     return(MyDAL.AddOrdersLog(entity));
 }