예제 #1
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "p")
            {
                RentProductBll pBll = new RentProductBll();
                RentLogModel   log  = bll.GetModel(Convert.ToInt32(e.CommandArgument));


                pBll.UpdateStatus(log.RentID, (int)RentProductStatus.已出租);
                bll.UpdateStatus(log.RentLogID, (int)RentLogStatus.已确认);
            }
        }
예제 #2
0
        private void BindData()
        {
            RentLogModel     log     = bll.GetModel(RentID, GetUserID());
            RentProductModel product = new RentProductBll().GetModel(RentID);

            for (int i = 1; i <= product.MaxRentTime; i++)
            {
                ListItem item = new ListItem();
                item.Text  = i.ToString();
                item.Value = i.ToString();
                DropDown_RentTime.Items.Add(item);
            }

            if (log != null)
            {
                Div_ApplyContent.InnerHtml = "对不起,您已经申请过了,请返回<a href=\"/member/rent/rentloglist.aspx\">用户中心</a>查看。";
                Button_Add.Enabled         = false;
            }
        }
        public void Update(RentLogModel model)
        {
            DbCommand Command = dbw.GetStoredProcCommand("UP_mwRentLog_Update");

            dbw.AddInParameter(Command, "@RentorderID", DbType.Int32, model.RentLogID);
            dbw.AddInParameter(Command, "@RentID", DbType.Int32, model.RentID);
            dbw.AddInParameter(Command, "@UserID", DbType.String, model.UserID);
            dbw.AddInParameter(Command, "@PaySum", DbType.Decimal, model.PaySum);
            dbw.AddInParameter(Command, "@ApplyInfo", DbType.String, model.ApplyInfo);
            dbw.AddInParameter(Command, "@rentmonths", DbType.Int32, model.RentMonths);
            dbw.AddInParameter(Command, "@ApplyTime", DbType.DateTime, model.ApplyTime);
            dbw.AddInParameter(Command, "@StartTime", DbType.DateTime, model.StartTime);
            dbw.AddInParameter(Command, "@EndTime", DbType.DateTime, model.EndTime);
            dbw.AddInParameter(Command, "@Status", DbType.Int16, model.Status);
            dbw.AddInParameter(Command, "@truename", DbType.String, model.Truename);
            dbw.AddInParameter(Command, "@phone", DbType.String, model.Phone);
            dbw.AddInParameter(Command, "@cellphone", DbType.String, model.Cellphone);
            dbw.AddInParameter(Command, "@postcode", DbType.String, model.Postcode);
            dbw.AddInParameter(Command, "@region", DbType.String, model.Region);
            dbw.AddInParameter(Command, "@address", DbType.String, model.Address);

            dbw.ExecuteNonQuery(Command);
        }
        private RentLogModel GetModel(DataRow row)
        {
            RentLogModel model = new RentLogModel();

            model.ApplyInfo  = Convert.ToString(row["applyinfo"]);
            model.ApplyTime  = Convert.ToDateTime(row["applytime"]);
            model.EndTime    = Convert.ToDateTime(row["endtime"]);
            model.PaySum     = Convert.ToDecimal(row["paysum"]);
            model.RentID     = Convert.ToInt32(row["rentid"]);
            model.RentLogID  = Convert.ToInt32(row["rentorderid"]);
            model.StartTime  = Convert.ToDateTime(row["starttime"]);
            model.Status     = Convert.ToInt16(row["status"]);
            model.UserID     = Convert.ToString(row["userid"]);
            model.RentMonths = Convert.ToInt32(row["rentmonths"]);
            model.Truename   = Convert.ToString(row["truename"]);
            model.Phone      = Convert.ToString(row["phone"]);
            model.Cellphone  = Convert.ToString(row["cellphone"]);
            model.Postcode   = Convert.ToString(row["postcode"]);
            model.Region     = Convert.ToString(row["region"]);
            model.Address    = Convert.ToString(row["address"]);

            return(model);
        }
 public void Update(RentLogModel model)
 {
     dal.Update(model);
 }
 public void Add(RentLogModel model)
 {
     dal.Add(model);
 }