private void RptBind(string _strWhere, string _orderby) { this.page = AXRequest.GetQueryInt("page", 1); if (this.product_category_id > 0) { this.ddlproduct_category_id.SelectedValue = this.product_category_id.ToString(); } txtNote_no.Text = this.note_no; txtstart_time.Value = this.start_time; txtstop_time.Value = this.stop_time; ps_join_depot bll = new ps_join_depot(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("backdepot_list.aspx", "start_time={0}&stop_time={1}&product_category_id={2}¬e_no={3}&page={4}", this.start_time.ToString(), this.stop_time.ToString(), this.product_category_id.ToString(), this.note_no, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private bool DoEdit(int _id) { DateTime now = DateTime.Now; string note_no = now.ToString("yy") + now.ToString("MM") + now.ToString("dd") + now.ToString("HH") + now.ToString("mm") + now.ToString("ss"); bool result = false; ps_here_depot model = new ps_here_depot(); model.GetModel(_id); model.product_num = int.Parse(Litproduct_num.Text) - int.Parse(txtproduct_num.Text); ps_join_depot model1 = new ps_join_depot(); model1.product_category_id = model.product_category_id; model1.note_no = note_no; model1.add_time = DateTime.Now; model1.product_name = model.product_name; model1.product_code_state = "退货"; model1.go_price = model.go_price; model1.salse_price = model.salse_price; model1.user_id = Convert.ToInt32(Session["AID"]); model1.product_num = int.Parse(txtproduct_num.Text); model1.here_depot_id = _id; model1.dw = model.dw; model1.Add(); if (model.UpdateALL()) { mym.AddAdminLog("出库", "出库商品:" + txtproduct_name.Text); //记录日志 result = true; } return(result); }
// 单个删除 protected void lbtnDelCa_Click(object sender, EventArgs e) { // 当前点击的按钮 LinkButton lb = (LinkButton)sender; int caId = int.Parse(lb.CommandArgument); ps_manager bll = new ps_manager(); bll.GetModel(caId); string title = bll.user_name; ps_join_depot bllqd = new ps_join_depot(); bllqd.user_id = caId; ps_salse_depot bllss = new ps_salse_depot(); bllss.user_id = caId; if (!bllqd.ExistsYH() && !bllss.ExistsCZXS()) { bll.Delete(caId); mym.AddAdminLog("删除", "删除用户名(账号):" + title + ""); //记录日志 mym.JscriptMsg(this.Page, " 成功删除用户名(账号):" + title + "", Utils.CombUrlTxt("manager_list.aspx", "status={0}&category_id={1}&depot_id={2}&keywords={3}&page={4}", this.status.ToString(), this.category_id.ToString(), this.depot_id.ToString(), this.keywords, this.page.ToString()), "Success"); } else { mym.JscriptMsg(this.Page, "系统中有该用户的相关操作记录,不能删除!可以通过修改禁用该用户!", "", "Error"); return; } }
//绑定记录 public void binddr() { string sqlstr = ""; ps_join_depot bll = new ps_join_depot(); if (Convert.ToInt32(Session["DepotID"]) == 0 && Convert.ToInt32(Session["DepotCatID"]) == 0) { sqlstr = "product_code_state='入库' "; sqlstr = sqlstr + CombSqlTxt(this.product_category_id, this.note_no, this.start_time, this.stop_time); } sqlstr = sqlstr + " order by add_time desc,id desc"; DataView dv = bll.GetList(sqlstr).Tables[0].DefaultView; repCategory.DataSource = dv; repCategory.DataBind(); }
private bool DoAdd() { DateTime now = DateTime.Now; string note_no = now.ToString("yy") + now.ToString("MM") + now.ToString("dd") + now.ToString("HH") + now.ToString("mm") + now.ToString("ss"); ps_join_depot model = new ps_join_depot(); model.product_category_id = int.Parse(ddlproduct_category_id.SelectedValue); model.note_no = note_no; model.add_time = DateTime.Now; model.product_name = txtproduct_name.Text; model.product_code_state = "入库"; model.go_price = Convert.ToDecimal(txtgo_price.Text); model.salse_price = Convert.ToDecimal(txtsalse_price.Text); model.user_id = Convert.ToInt32(Session["AID"]); model.product_num = int.Parse(txtproduct_num.Text); model.dw = txtdw.Text; ps_here_depot model1 = new ps_here_depot(); model1.product_url = txtImgUrl.Text; model1.product_category_id = int.Parse(ddlproduct_category_id.SelectedValue); model1.add_time = DateTime.Now; model1.product_name = txtproduct_name.Text; model1.go_price = Convert.ToDecimal(txtgo_price.Text); model1.salse_price = Convert.ToDecimal(txtsalse_price.Text); model1.user_id = Convert.ToInt32(Session["AID"]); model1.product_num = int.Parse(txtproduct_num.Text); model1.dw = txtdw.Text; model1.remark = txtremark.Text; model1.Add(); model.here_depot_id = model1.GetMaxId(Convert.ToInt32(Session["AID"])); if (model.Add() > 0) { mym.AddAdminLog("入库", "商品入库,入库单号:" + note_no); //记录日志 return(true); } return(false); }