Ejemplo n.º 1
0
        public JsonResult AddGuestSave(MODEL.T_DIC_Guest model)
        {
            BLL.T_DIC_Guest bll    = new BLL.T_DIC_Guest();
            bool            result = bll.AddGuest(model);

            if (result)
            {
                MODEL.Message message = new MODEL.Message();
                message.statusCode   = "200";
                message.message      = "增加客户成功!";
                message.navTabId     = "GuestList";
                message.rel          = "GuestList";
                message.forwardUrl   = "";
                message.callbackType = "closeCurrent";
                return(Json(message));
            }
            else
            {
                MODEL.Message message = new MODEL.Message();
                message.statusCode   = "300";
                message.message      = "增加客户失败!";
                message.navTabId     = "GuestList";
                message.rel          = "GuestList";
                message.forwardUrl   = "";
                message.callbackType = "closeCurrent";
                return(Json(message));
            }
        }
Ejemplo n.º 2
0
        public void slt_info(MODEL.Message mes)
        {
            string sql = "select id,psw,name,sex,college,grade,email,phone,major,guidance,Title,number from teacher where id = @id";

            SqlParameter[] paras = new SqlParameter[]
            {
                new SqlParameter("@id", mes.Id),
            };
            DataTable dt = SqlDbHelper.ExecuteDataTable(sql.ToString(), CommandType.Text, paras);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                mes.Name     = dt.Rows[i]["name"].ToString();
                mes.Psd      = dt.Rows[i]["psw"].ToString();
                mes.Sex      = dt.Rows[i]["sex"].ToString();
                mes.College  = dt.Rows[i]["college"].ToString();
                mes.Grade    = dt.Rows[i]["grade"].ToString();
                mes.Email    = dt.Rows[i]["email"].ToString();
                mes.Phone    = dt.Rows[i]["phone"].ToString();
                mes.Major    = dt.Rows[i]["major"].ToString();
                mes.Gudiance = dt.Rows[i]["guidance"].ToString();
                mes.Title    = dt.Rows[i]["Title"].ToString();
                mes.Number   = int.Parse(dt.Rows[i]["number"].ToString());
            }
        }
Ejemplo n.º 3
0
        public bool insert(MODEL.Message mes)
        {
            string sql;

            if (!isExitence(mes))
            {
                sql = "insert into teacher(id,name,sex,college,grade,email,phone,major,guidance,Title,number) values(@id,@name,@sex,@college,@grade,@email,@phone,@major,@guidance,@title,@number)";
            }
            else
            {
                sql = "update teacher set name=@name,sex=@sex,college=@college,grade=@grade,email=@email,phone=@phone,major=@major,guidance=@guidance,Title=@title,number=@number where id=@id";
            }
            SqlParameter[] paras = new SqlParameter[]
            {
                new SqlParameter("@id", mes.Id),
                new SqlParameter("@name", mes.Name),
                new SqlParameter("@sex", mes.Sex),
                new SqlParameter("@college", mes.College),
                new SqlParameter("@grade", mes.Grade),
                new SqlParameter("@email", mes.Email),
                new SqlParameter("@phone", mes.Phone),
                new SqlParameter("@major", mes.Major),
                new SqlParameter("@guidance", mes.Gudiance),
                new SqlParameter("@title", mes.Title),
                new SqlParameter("@number", mes.Number)
            };
            int count = SqlDbHelper.ExecuteNonQuery(sql.ToString(), CommandType.Text, paras);

            if (count == 1)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 4
0
        //Guest删除功能
        public JsonResult Delete(int uid)
        {
            BLL.T_DIC_Guest bll    = new BLL.T_DIC_Guest();
            bool            result = bll.Delete(uid);

            if (result)
            {
                MODEL.Message message = new MODEL.Message();
                message.statusCode   = "200";
                message.message      = "删除客户成功!";
                message.navTabId     = "GuestList";
                message.rel          = "GuestList";
                message.forwardUrl   = "";
                message.callbackType = " ";
                return(Json(message));
            }
            else
            {
                MODEL.Message message = new MODEL.Message();
                message.statusCode   = "300";
                message.message      = "删除客户失败!";
                message.navTabId     = "GuestList";
                message.rel          = "GuestList";
                message.forwardUrl   = "";
                message.callbackType = " ";
                return(Json(message));
            }
        }
Ejemplo n.º 5
0
        public ActionResult Delete(string ids)
        {
            Book.BLL.V_Stock_Out     bll  = new Book.BLL.V_Stock_Out();
            Book.BLL.T_STOCK_OutBody bll2 = new Book.BLL.T_STOCK_OutBody();
            //分离逗号的方法
            string[] list = ids.Split(',');
            int      flag = 0;

            for (int i = 0; i < list.Length; i++)
            {
                bool result  = bll.DeleteList(list[i]);
                bool result2 = bll.DeleteStr(list[i]);
                if (result && result2)
                {
                    flag++;
                }
            }
            if (flag > 0)
            {
                MODEL.Message message = BookProject.Public.U_CloseSMess("InList", "InList", "删除出库单成功!");
                return(Json(message));
            }
            else
            {
                MODEL.Message message = BookProject.Public.U_CloseFMess("InList", "InList", "删除入库单失败!");
                return(Json(message));
            }
        }
Ejemplo n.º 6
0
 public static MODEL.Message LoginSuc()
 {
     MODEL.Message message = new MODEL.Message();
     message.statusCode   = "200";
     message.message      = "修改密码成功";
     message.navTabId     = "Exit";
     message.rel          = "Exit";
     message.forwardUrl   = "Exit";
     message.callbackType = "";
     return(message);
 }
Ejemplo n.º 7
0
 public static MODEL.Message U_CloseFMess(string TabID, string Rel, string AlertMes)
 {
     MODEL.Message message = new MODEL.Message();
     message.statusCode   = "300";
     message.message      = AlertMes;
     message.navTabId     = TabID;
     message.rel          = Rel;
     message.forwardUrl   = "";
     message.callbackType = "";
     return(message);
 }
Ejemplo n.º 8
0
 public bool InsertMessage(MODEL.Message mess, out string msg)
 {
     if (dao_mess.insert(mess))
     {
         msg = "更改成功";
     }
     else
     {
         msg = "更改失败";
     }
     return(true);
 }
Ejemplo n.º 9
0
 public JsonResult AddBookSave(MODEL.T_DIC_Book book)
 {
     BLL.T_DIC_Book bll = new BLL.T_DIC_Book();
     if (bll.AddBook(book))
     {
         MODEL.Message message = BookProject.Public.T_CloseSMess("BookList", "BookList", "增加书籍成功!");
         return(Json(message));
     }
     else
     {
         MODEL.Message message = BookProject.Public.T_CloseSMess("BookList", "BookList", "增加书籍失败!");
         return(Json(message));
     }
 }
Ejemplo n.º 10
0
 public JsonResult ChangePwdSave()
 {
     string pwd = Convert.ToString(Request.Form["Pwd"]);
     bool result = BookProject.Tools.XMLParser.ChangePwd(pwd);
     if (result)
     {
         MODEL.Message message = BookProject.Public.LoginSuc();
         return Json(message);
     }
     else
     {
         return Json("");
     }
 }
Ejemplo n.º 11
0
        public JsonResult AddUserSave(MODEL.T_DIC_User user)
        {
            BLL.T_DIC_User bll = new BLL.T_DIC_User();

            //if (bll.AddUser(user))//数据库操作
            if (BookProject.Tools.XMLParser.AddUser(user))//XML文件操作
            {
                MODEL.Message message = BookProject.Public.T_CloseSMess("UserList", "UserList", "注册用户成功!");
                return(Json(message));
            }
            else
            {
                MODEL.Message message = BookProject.Public.T_CloseFMess("UserList", "UserList", "注册用户失败!");
                return(Json(message));
            }
        }
Ejemplo n.º 12
0
        public bool isExitence(MODEL.Message mes)
        {
            string sql = "select count(*) from teacher where id = @id";

            SqlParameter[] paras = new SqlParameter[]
            {
                new SqlParameter("@id", mes.Id),
            };
            int count = (int)SqlDbHelper.ExecuteScalar(sql.ToString(), CommandType.Text, paras);

            if (count == 1)
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 13
0
/// <summary>
/// DeleteBook
/// </summary>
/// <param name="uid"></param>
/// <returns></returns>
        public JsonResult Delete(int uid)
        {
            BLL.T_DIC_Book bll    = new BLL.T_DIC_Book();
            bool           result = bll.Delete(uid);

            if (result)
            {
                MODEL.Message message = BookProject.Public.U_CloseSMess("BookList", "BookList", "删除书籍成功!");
                return(Json(message));
            }
            else
            {
                MODEL.Message message = BookProject.Public.U_CloseFMess("BookList", "BookList", "删除书籍失败!");
                return(Json(message));
            }
        }
Ejemplo n.º 14
0
        public JsonResult EditBookSave(MODEL.T_DIC_Book book)
        {
            BLL.T_DIC_Book bll    = new BLL.T_DIC_Book();
            bool           result = bll.Update(book);

            if (result)
            {
                MODEL.Message message = BookProject.Public.T_CloseSMess("BookList", "BookList", "编辑书籍成功!");
                return(Json(message));
            }
            else
            {
                MODEL.Message message = BookProject.Public.T_CloseSMess("BookList", "BookList", "编辑书籍失败!");
                return(Json(message));
            }
        }
Ejemplo n.º 15
0
        public JsonResult EditUserSave(MODEL.T_DIC_User model)
        {
            BLL.T_DIC_User bll = new BLL.T_DIC_User();
            //bool result=bll.Update(model);
            bool result = BookProject.Tools.XMLParser.EditSave(model);

            if (result)
            {
                MODEL.Message message = BookProject.Public.T_CloseSMess("UserList", "UserList", "编辑用户成功!");
                return(Json(message));
            }
            else
            {
                MODEL.Message message = BookProject.Public.T_CloseFMess("UserList", "UserList", "编辑用户失败!");
                return(Json(message));
            }
        }
Ejemplo n.º 16
0
/// <summary>
/// DeleteUser
/// </summary>
/// <param name="uid"></param>
/// <returns></returns>
        public JsonResult Delete(int uid)
        {
            BLL.T_DIC_User bll = new BLL.T_DIC_User();
            //bool result = bll.Delete(uid);
            bool result = BookProject.Tools.XMLParser.DeleteUser(uid);

            if (result)
            {
                MODEL.Message message = BookProject.Public.U_CloseSMess("UserList", "UserList", "删除用户成功!");
                return(Json(message));
            }
            else
            {
                MODEL.Message message = BookProject.Public.U_CloseFMess("UserList", "UserList", "删除用户失败!");
                return(Json(message));
            }
        }
Ejemplo n.º 17
0
        public JsonResult AddSave()
        {
            Book.Model.T_STOCK_OutHead head = new Book.Model.T_STOCK_OutHead();
            head.CeateTime   = Convert.ToDateTime(Request.Form["CreateName"]);
            head.OrderNumber = Convert.ToString(Request.Form["OrderNumber"]);
            head.GuestID     = Convert.ToInt32(Request.Form["json.ID"]);
            head.GuestName   = Convert.ToString(Request.Form["json.Name"]);
            head.UserID      = 1;
            head.UserName    = "******";

            List <Book.Model.T_STOCK_OutBody> lst = new List <Book.Model.T_STOCK_OutBody>();
            int i = 0;

            while (Request.Form["items[" + i + "].book.ID"] != null)
            {
                Book.Model.T_STOCK_OutBody body = new Book.Model.T_STOCK_OutBody();

                string BookID = Request.Form["items[" + i + "].book.ID"];
                BookID        = BookID.Replace(",", "");
                body.BookID   = Convert.ToInt32(BookID);
                body.Discount = Convert.ToDecimal(Request.Form["items[" + i + "].book.Discount"]);
                body.InHeadID = 0;
                body.Num      = Convert.ToInt32(Request.Form["items[" + i + "].book.Num"]);
                body.Price    = Convert.ToDecimal(Request.Form["items[" + i + "].book.Price"]);

                lst.Add(body);

                i++;
            }
            BLL.T_Stock_Out bll    = new BLL.T_Stock_Out();
            bool            result = bll.Add(head, lst);

            if (result)
            {
                MODEL.Message message = new MODEL.Message();
                message = BookProject.Public.T_CloseSMess("OutList", "OutList", "添加出库单成功!");
                return(Json(message));
            }
            else
            {
                MODEL.Message message = new MODEL.Message();
                message = BookProject.Public.T_CloseFMess("InList", "InList", "添加入库单失败!");
                return(Json(message));
            }
        }
Ejemplo n.º 18
0
 public void select_info(MODEL.Message mess)
 {
     dao_mess.slt_info(mess);
 }