Beispiel #1
0
 /// <summary>
 ///无分页获取列表
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public DataTable GetList(E_Scrap data)
 {
     SqlParameter[] parms =
     {
         new SqlParameter("@EnterpriseID", SqlDbType.Int)
     };
     parms[0].Value = data.EnterpriseID;
     return(DbHelperSQL.RunProcedureTable("ProcEP_B_Scrap_ListSelect", parms));
 }
Beispiel #2
0
        /// <summary>
        /// 录入新报废理由
        /// </summary>
        void ScrapAdd()
        {
            MLMGC.Security.PersonalPage pp = new MLMGC.Security.PersonalPage(true);
            string  name = nv["name"];
            E_Scrap data = new E_Scrap();

            data.PersonalID = pp.PersonalID;
            data.ScrapID    = 0;
            data.ScrapName  = name;
            int scrapid = new T_Scrap().Add(data);

            HttpContext.Current.Response.Write(scrapid);
        }
Beispiel #3
0
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public int Delete(E_Scrap data)
        {
            SqlParameter[] parms =
            {
                new SqlParameter("@EnterpriseID", SqlDbType.Int),
                new SqlParameter("@ScrapID",      SqlDbType.Int)
            };
            parms[0].Value = data.EnterpriseID;
            parms[1].Value = data.ScrapID;
            int ReturnValue = 0, irowsAffected = 0;

            irowsAffected = DbHelperSQL.RunProcedures("ProcEP_B_Scrap_Delete", parms, out ReturnValue);
            return(ReturnValue);
        }
Beispiel #4
0
        /// <summary>
        /// 删除一条数据
        /// </summary>
        /// <remarks>tianzhenyun 2011-10-19</remarks>
        public bool Delete(E_Scrap data)
        {
            SqlParameter[] parms =
            {
                new SqlParameter("@PersonalID", SqlDbType.Int),
                new SqlParameter("@ScrapID",    SqlDbType.Int)
            };
            parms[0].Value = data.PersonalID;
            parms[1].Value = data.ScrapID;
            int ReturnValue = 0, irowsAffected = 0;

            irowsAffected = DbHelperSQL.RunProcedures("ProcPI_B_Scrap_Delete", parms, out ReturnValue);
            return(ReturnValue > 0);
        }
Beispiel #5
0
        /// <summary>
        /// 删除报废理由
        /// </summary>
        void ScrapDelete()
        {
            MLMGC.Security.PersonalPage pp = new MLMGC.Security.PersonalPage(true);
            int scrapid = 0;

            int.TryParse(nv["scrapid"], out scrapid);
            E_Scrap data = new E_Scrap();

            data.PersonalID = pp.PersonalID;
            data.ScrapID    = scrapid;
            bool b = new T_Scrap().Delete(data);

            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
Beispiel #6
0
        /// <summary>
        /// 报废理由是否存在
        /// </summary>
        void ScrapExists()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            int scrapid = 0;

            int.TryParse(nv["scrapid"], out scrapid);
            string  name = nv["name"];
            E_Scrap data = new E_Scrap();

            data.EnterpriseID = ep.EnterpriceID;
            data.ScrapID      = scrapid;
            data.ScrapName    = name;
            bool b = new T_Scrap().Exists(data);

            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
Beispiel #7
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(E_Scrap data)
        {
            SqlParameter[] parms =
            {
                new SqlParameter("@EnterpriseID", SqlDbType.Int),
                new SqlParameter("@ScrapName",    SqlDbType.NVarChar, 128)
            };
            parms[0].Value = data.EnterpriseID;
            parms[1].Value = data.ScrapName;

            int ReturnValue = 0;

            DbHelperSQL.RunProcedures("ProcEP_B_Scrap_Insert", parms, out ReturnValue);
            data.ScrapID = ReturnValue;
            return(ReturnValue);
        }
Beispiel #8
0
        /// <summary>
        /// 录入新报废理由
        /// </summary>
        void ScrapAdd()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            string  name = nv["name"];
            E_Scrap data = new E_Scrap();

            data.EnterpriseID = ep.EnterpriceID;
            data.ScrapID      = 0;
            data.ScrapName    = name;
            int scrapid = new T_Scrap().Add(data);

            new MLMGC.BLL.Enterprise.T_Log().Add(new MLMGC.DataEntity.Enterprise.E_Log()
            {
                EnterpriseID = ep.EnterpriceID, UserID = ep.UserID, LogTitle = "添加报废理由", IP = MLMGC.COMP.Requests.GetRealIP()
            });
            HttpContext.Current.Response.Write(scrapid);
        }
Beispiel #9
0
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <remarks>tianzhenyun 2011-10-19</remarks>
        public bool Exists(E_Scrap data)
        {
            SqlParameter[] parms =
            {
                new SqlParameter("@PersonalID", SqlDbType.Int),
                new SqlParameter("@ScrapID",    SqlDbType.Int),
                new SqlParameter("@ScrapName",  SqlDbType.NVarChar, 128)
            };
            parms[0].Value = data.PersonalID;
            parms[1].Value = data.ScrapID;
            parms[2].Value = data.ScrapName;

            int ReturnValue = 0;

            DbHelperSQL.RunProcedures("ProcPI_B_Scrap_Exists", parms, out ReturnValue);
            return(ReturnValue == 1);
        }
Beispiel #10
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(E_Scrap data)
        {
            SqlParameter[] parms =
            {
                new SqlParameter("@EnterpriseID", SqlDbType.Int),
                new SqlParameter("@ScrapID",      SqlDbType.Int),
                new SqlParameter("@ScrapName",    SqlDbType.NVarChar, 128)
            };
            parms[0].Value = data.EnterpriseID;
            parms[1].Value = data.ScrapID;
            parms[2].Value = data.ScrapName;

            int ReturnValue = 0, irowsAffected = 0;

            irowsAffected = DbHelperSQL.RunProcedures("ProcEP_B_Scrap_Update", parms, out ReturnValue);
            return(ReturnValue > 0);
        }
Beispiel #11
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public E_Scrap GetModel(E_Scrap data)
        {
            SqlParameter[] parms =
            {
                new SqlParameter("@EnterpriseID", SqlDbType.Int),
                new SqlParameter("@ScrapID",      SqlDbType.Int)
            };
            parms[0].Value = data.EnterpriseID;
            parms[1].Value = data.ScrapID;
            DataTable dt = DbHelperSQL.RunProcedureTable("ProcEP_B_Scrap_Select", parms);

            if (dt != null && dt.Rows.Count == 1)
            {
                data.ScrapName = dt.Rows[0]["ScrapName"].ToString();
            }
            return(data);
        }
Beispiel #12
0
        /// <summary>
        /// 删除报废理由
        /// </summary>
        void ScrapDelete()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            int scrapid = 0;

            int.TryParse(nv["scrapid"], out scrapid);
            E_Scrap data = new E_Scrap();

            data.EnterpriseID = ep.EnterpriceID;
            data.ScrapID      = scrapid;
            int result = new T_Scrap().Delete(data);

            new MLMGC.BLL.Enterprise.T_Log().Add(new MLMGC.DataEntity.Enterprise.E_Log()
            {
                EnterpriseID = ep.EnterpriceID, UserID = ep.UserID, LogTitle = "删除报废理由", IP = MLMGC.COMP.Requests.GetRealIP()
            });
            HttpContext.Current.Response.Write(result.ToString());
        }
Beispiel #13
0
        /// <summary>
        /// 修改报废理由
        /// </summary>
        void ScrapUpdate()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            int scrapid = 0;

            int.TryParse(nv["scrapid"], out scrapid);
            string  name = nv["name"];
            E_Scrap data = new E_Scrap();

            data.EnterpriseID = ep.EnterpriceID;
            data.ScrapID      = scrapid;
            data.ScrapName    = name;
            bool b = new T_Scrap().Update(data);

            new MLMGC.BLL.Enterprise.T_Log().Add(new MLMGC.DataEntity.Enterprise.E_Log()
            {
                EnterpriseID = ep.EnterpriceID, UserID = ep.UserID, LogTitle = "修改报废理由", IP = MLMGC.COMP.Requests.GetRealIP()
            });
            HttpContext.Current.Response.Write(b ? "1" : "0");
        }
Beispiel #14
0
        /// <summary>
        /// 获取显示报废理由
        /// </summary>
        void ScrapShow()
        {
            MLMGC.Security.EnterprisePage ep = new MLMGC.Security.EnterprisePage(true);
            int scrapid = 0;

            int.TryParse(nv["scrapid"], out scrapid);
            E_Scrap data = new E_Scrap();

            data.EnterpriseID = ep.EnterpriceID;
            data.ScrapID      = scrapid;
            data = new T_Scrap().GetModel(data);
            if (data == null)
            {
                data         = new E_Scrap();
                data.ScrapID = 0;
            }
            JsonObjectCollection colDR = new JsonObjectCollection();

            colDR.Add(new JsonStringValue("id", data.ScrapID.ToString()));
            colDR.Add(new JsonStringValue("name", data.ScrapName));
            HttpContext.Current.Response.Write(colDR.ToString());
        }
Beispiel #15
0
 /// <summary>
 ///无分页获取列表
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public DataTable GetList(E_Scrap data)
 {
     return(dal.GetList(data));
 }
Beispiel #16
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public E_Scrap GetModel(E_Scrap data)
 {
     return(dal.GetModel(data));
 }
Beispiel #17
0
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public bool Delete(E_Scrap data)
 {
     return(dal.Delete(data));
 }
Beispiel #18
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(E_Scrap data)
 {
     return(dal.Update(data));
 }
Beispiel #19
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(E_Scrap data)
 {
     return(dal.Add(data));
 }
Beispiel #20
0
 /// <summary>
 /// 是否存在该记录
 /// </summary>
 public bool Exists(E_Scrap data)
 {
     return(dal.Exists(data));
 }
Beispiel #21
0
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public int Delete(E_Scrap data)
 {
     return(dal.Delete(data));
 }