private bool DoEdit(int _id) { try { BLL.user_pm bll = new BLL.user_pm(); Model.user_pm model = bll.GetModel(_id); model.name = txtName.Text; model.sex = Convert.ToInt32(rblSex.SelectedValue); model.origin = txtOrigin.Text; model.phone = txtPhone.Text; model.comname = txtComName.Text; model.job = txtJob.Text; model.year = Convert.ToInt32(txtYear.Text); model.jobimg = jobImg.Text; model.img = txtImg.Text; model.add_time = Convert.ToDateTime(txtAddTime.Text); model.pass_time = Convert.ToDateTime(txtPassTime.Text); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改产品经理信息"); //记录日志 return(true); } } catch { return(false); } return(false); }
private void get_pm_model(HttpContext context) { int id = DTRequest.GetInt("id", 0); DataTable dt = new BLL.user_pm().GetList(0, "user_id=" + id, "").Tables[0]; dt.Columns.Add("start", typeof(float)); dt.Columns.Add("call", typeof(int)); DataTable t = new BLL.user().DoSql("select avg(value) as start,count(1) as call from fg_assess"); dt.Rows[0]["start"] = t.Rows[0]["start"] == DBNull.Value ? 0 : t.Rows[0]["start"]; dt.Rows[0]["call"] = t.Rows[0]["call"]; context.Response.Write(JsonHelper.DataTableToJSON(dt).TrimStart('[').TrimEnd(']')); }
protected void btnUnPass_Click(object sender, EventArgs e) { ChkAdminLevel("pro_pm_list", DTEnums.ActionEnum.Audit.ToString()); //检查权限 BLL.user_pm bll = new BLL.user_pm(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { bll.UpdateField(id, "status=3,pass_time=getdate()"); } } AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "审核客户经理"); //记录日志 JscriptMsg("审核数据成功!", Utils.CombUrlTxt("pm_list.aspx", "", "")); }
//删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("pro_pm_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限 BLL.user_pm bll = new BLL.user_pm(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { bll.Delete(id); } } AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "删除产品分类数据"); //记录日志 JscriptMsg("删除数据成功!", Utils.CombUrlTxt("pm_list.aspx", "", "")); }
private void ShowInfo(int id) { Model.user_pm model = new BLL.user_pm().GetModel(id); if (model.status != 1) { btnPass.Visible = false; btnPass2.Visible = false; } txtName.Text = model.name; rblSex.SelectedValue = model.sex.ToString(); txtOrigin.Text = model.origin; txtPhone.Text = model.phone; txtComName.Text = model.comname; txtJob.Text = model.job; txtYear.Text = model.year.ToString(); jobImg.Text = model.jobimg; txtImg.Text = model.img; txtAddTime.Text = model.add_time.ToString("yyyy-MM-dd HH:mm:ss"); txtPassTime.Text = model.pass_time.ToString("yyyy-MM-dd HH:mm:ss"); }
private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); this.txtKeywords.Text = this.keywords; DataTable dt = new BLL.user_pm().GetList(pageSize, this.page, _strWhere, _orderby, out this.totalCount).Tables[0]; dt.Columns.Add("username", typeof(string)); foreach (DataRow dr in dt.Rows) { string name = new BLL.user().GetModel(Convert.ToInt32(dr["user_id"])).nickname; dr["username"] = name; } this.rptList.DataSource = dt; this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("pm_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void get_pro_model(HttpContext context) { int id = DTRequest.GetInt("id", 0); int uid = DTRequest.GetInt("uid", 0); DataTable dt = new BLL.product().GetList(1, "id=" + id, "").Tables[0]; DataRow dr = new BLL.user_pm().GetList(1, "user_id=" + Convert.ToInt32(dt.Rows[0]["user_id"]), "").Tables[0].Rows[0]; if (dt.Rows.Count > 0) { string pass_time = Convert.ToDateTime(dt.Rows[0]["pass_time"]).ToString("yyyy-MM-dd HH:mm"); string add_time = Convert.ToDateTime(dt.Rows[0]["add_time"]).ToString("yyyy-MM-dd HH:mm"); dt.Columns.Remove("pass_time"); dt.Columns.Add("pass_time", typeof(string)); dt.Columns.Remove("add_time"); dt.Columns.Add("add_time", typeof(string)); dt.Columns.Add("isCollect", typeof(int)); dt.Rows[0]["pass_time"] = pass_time; dt.Rows[0]["add_time"] = add_time; dt.Columns.Add("category2", typeof(int)); dt.Rows[0]["category2"] = new BLL.pro_category().GetModel(Convert.ToInt32(dt.Rows[0]["category"])).parent_id; if (uid != 0) { dt.Rows[0]["isCollect"] = new BLL.news_view().GetCount("user_id=" + uid + " and isPN=2 and type=2 and news_id=" + dt.Rows[0]["id"].ToString()) > 0 ? 1 : 0; } else { dt.Rows[0]["isCollect"] = 0; } dt.Columns.Add("pm_id", typeof(int)); dt.Rows[0]["pm_id"] = dr["user_id"]; dt.Columns.Add("pm_name", typeof(string)); dt.Rows[0]["pm_name"] = dr["name"]; dt.Columns.Add("pm_tel", typeof(string)); dt.Rows[0]["pm_tel"] = dr["phone"]; context.Response.Write(JsonHelper.DataTableToJSON(dt).TrimEnd(']').TrimStart('[')); } }