//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("plugin_lineservice_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.online_service bll = new BLL.online_service(); 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) { if (bll.Delete(id)) { sucCount++; } else { errorCount++; } } } AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除在线客服成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("index.aspx", "group_id={0}&keywords={1}", this.group_id.ToString(), this.keywords), "Success"); }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("plugin_lineservice_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.online_service bll = new BLL.online_service(); 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) { if (bll.Delete(id)) { sucCount++; } else { errorCount++; } } } AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除在线客服成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("index.aspx", "group_id={0}&keywords={1}", this.group_id.ToString(), this.keywords), "Success"); }
private void RptBind(string _strWhere, string _orderby) { this.txtKeywords.Text = this.keywords; BLL.online_service bll = new BLL.online_service(); this.rptList.DataSource = bll.GetList(0, _strWhere, _orderby); this.rptList.DataBind(); }
private void RptBind(string _strWhere, string _orderby) { if (this.group_id > 0) { ddlGroupId.SelectedValue = this.group_id.ToString(); } txtKeywords.Text = this.keywords; BLL.online_service bll = new BLL.online_service(); this.rptList.DataSource = bll.GetList(0, _strWhere, _orderby); this.rptList.DataBind(); }
private void ShowInfo(int _id) { BLL.online_service bll = new BLL.online_service(); Model.online_service model = bll.GetModel(_id); ddlGroupId.SelectedValue = model.group_id.ToString(); txtTitle.Text = model.title; rblIsLock.SelectedValue = model.is_lock.ToString(); txtSortId.Text = model.sort_id.ToString(); txtLinkUrl.Text = model.link_url; txtImgUrl.Text = model.img_url; }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { BLL.online_service bll = new BLL.online_service(); 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); } } JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("index.aspx", "keywords={0}", this.keywords), "Success"); }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { BLL.online_service bll = new BLL.online_service(); 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); } } JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("index.aspx", "keywords={0}", this.keywords), "Success"); }
//保存排序 protected void btnSave_Click(object sender, EventArgs e) { BLL.online_service bll = new BLL.online_service(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); int sortId; if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId)) { sortId = 99; } bll.UpdateField(id, "sort_id=" + sortId.ToString()); } JscriptMsg("保存排序成功啦!", Utils.CombUrlTxt("index.aspx", "keywords={0}", this.keywords), "Success"); }
//保存排序 protected void btnSave_Click(object sender, EventArgs e) { BLL.online_service bll = new BLL.online_service(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); int sortId; if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId)) { sortId = 99; } bll.UpdateField(id, "sort_id=" + sortId.ToString()); } JscriptMsg("保存排序成功啦!", Utils.CombUrlTxt("index.aspx", "keywords={0}", this.keywords), "Success"); }
//设置操作 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value); BLL.online_service bll = new BLL.online_service(); Model.online_service model = bll.GetModel(id); switch (e.CommandName.ToLower()) { case "ibtnlock": if (model.is_lock == 1) bll.UpdateField(id, "is_lock=0"); else bll.UpdateField(id, "is_lock=1"); break; } this.RptBind("id>0" + CombSqlTxt(this.keywords), "sort_id asc,id desc"); }
//保存排序 protected void btnSave_Click(object sender, EventArgs e) { ChkAdminLevel("plugin_lineservice_list", DTEnums.ActionEnum.Edit.ToString()); //检查权限 BLL.online_service bll = new BLL.online_service(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); int sortId; if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId)) { sortId = 99; } bll.UpdateField(id, "sort_id=" + sortId.ToString()); } AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改在线客服排序"); //记录日志 JscriptMsg("保存排序成功!", Utils.CombUrlTxt("index.aspx", "group_id={0}&keywords={1}", this.group_id.ToString(), this.keywords), "Success"); }
//保存排序 protected void btnSave_Click(object sender, EventArgs e) { ChkAdminLevel("plugin_lineservice_list", DTEnums.ActionEnum.Edit.ToString()); //检查权限 BLL.online_service bll = new BLL.online_service(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); int sortId; if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId)) { sortId = 99; } bll.UpdateField(id, "sort_id=" + sortId.ToString()); } AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改在线客服排序"); //记录日志 JscriptMsg("保存排序成功!", Utils.CombUrlTxt("index.aspx", "group_id={0}&keywords={1}", this.group_id.ToString(), this.keywords), "Success"); }
private bool DoAdd() { bool result = true; Model.online_service model = new Model.online_service(); BLL.online_service bll = new BLL.online_service(); model.group_id = int.Parse(ddlGroupId.SelectedValue); model.title = txtTitle.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); model.link_url = txtLinkUrl.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.is_lock = int.Parse(rblIsLock.SelectedValue); model.add_time = DateTime.Now; if (bll.Add(model) < 1) { result = false; } return result; }
private bool DoAdd() { bool result = true; Model.online_service model = new Model.online_service(); BLL.online_service bll = new BLL.online_service(); model.group_id = int.Parse(ddlGroupId.SelectedValue); model.title = txtTitle.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); model.link_url = txtLinkUrl.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.is_lock = int.Parse(rblIsLock.SelectedValue); model.add_time = DateTime.Now; if (bll.Add(model) < 1) { result = false; } return(result); }
private bool DoEdit(int _id) { bool result = true; BLL.online_service bll = new BLL.online_service(); Model.online_service model = bll.GetModel(_id); model.group_id = int.Parse(ddlGroupId.SelectedValue); model.title = txtTitle.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); model.link_url = txtLinkUrl.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.is_lock = int.Parse(rblIsLock.SelectedValue); if (!bll.Update(model)) { result = false; } return(result); }
private bool DoAdd() { bool result = false; Model.online_service model = new Model.online_service(); BLL.online_service bll = new BLL.online_service(); model.group_id = int.Parse(ddlGroupId.SelectedValue); model.title = txtTitle.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); model.link_url = txtLinkUrl.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.is_lock = int.Parse(rblIsLock.SelectedValue); model.add_time = DateTime.Now; if (bll.Add(model) > 0) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加在线客服:" + model.title); //记录日志 result = true; } return result; }
//设置操作 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value); BLL.online_service bll = new BLL.online_service(); Model.online_service model = bll.GetModel(id); switch (e.CommandName.ToLower()) { case "ibtnlock": if (model.is_lock == 1) { bll.UpdateField(id, "is_lock=0"); } else { bll.UpdateField(id, "is_lock=1"); } break; } this.RptBind("id>0" + CombSqlTxt(this.keywords), "sort_id asc,id desc"); }
private bool DoAdd() { bool result = false; Model.online_service model = new Model.online_service(); BLL.online_service bll = new BLL.online_service(); model.group_id = int.Parse(ddlGroupId.SelectedValue); model.title = txtTitle.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); model.link_url = txtLinkUrl.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.is_lock = int.Parse(rblIsLock.SelectedValue); model.add_time = DateTime.Now; if (bll.Add(model) > 0) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加在线客服:" + model.title); //记录日志 result = true; } return(result); }
private bool DoEdit(int _id) { bool result = false; BLL.online_service bll = new BLL.online_service(); Model.online_service model = bll.GetModel(_id); model.group_id = int.Parse(ddlGroupId.SelectedValue); model.title = txtTitle.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); model.link_url = txtLinkUrl.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.is_lock = int.Parse(rblIsLock.SelectedValue); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改在线客服:" + model.title); //记录日志 result = true; } return(result); }
public void ProcessRequest(HttpContext context) { Model.install config = new BLL.install().loadConfig("../config/install.config"); if (config.status == 0) { context.Response.Write("{ \"info\":\"在线客服功能未开启!\", \"status\":0 }"); return; } this.id = DTRequest.GetQueryInt("id"); string strWhere = "is_lock=0"; if (this.id > 0) { strWhere += " and id=" + this.id; } DataSet ds = new BLL.online_service_group().GetList(0, "is_lock=0", "sort_id asc,id desc"); bool status = false; StringBuilder outHtml = new StringBuilder(); outHtml.Append("{"); outHtml.Append("\"status\":" + config.status + ","); outHtml.Append("\"content\":\"" + config.content + "\","); outHtml.Append("\"groups\":["); foreach (DataRow dr in ds.Tables[0].Rows) { if (status) { outHtml.Append(","); } else { status = true; } bool status2 = false; outHtml.Append("{"); outHtml.Append("\"title\":\"" + dr["title"].ToString() + "\","); outHtml.Append("\"mode\":\"" + dr["default_view"].ToString() + "\","); outHtml.Append("\"list\":["); DataSet ds1 = new BLL.online_service().GetList(0, "is_lock=0 and group_id=" + dr["id"].ToString(), "sort_id asc,add_time desc"); foreach (DataRow dr1 in ds1.Tables[0].Rows) { if (status2) { outHtml.Append(","); } else { status2 = true; } outHtml.Append("{"); outHtml.Append("\"name\":\"" + dr1["title"].ToString() + "\","); outHtml.Append("\"url\":\"" + dr1["link_url"].ToString() + "\","); outHtml.Append("\"img\":\"" + dr1["img_url"].ToString() + "\""); outHtml.Append("}"); } outHtml.Append("]"); outHtml.Append("}"); } outHtml.Append("]"); outHtml.Append("}"); context.Response.Write(outHtml.ToString()); }
private void RptBind(string _strWhere, string _orderby) { this.txtKeywords.Text = this.keywords; BLL.online_service bll = new BLL.online_service(); this.rptList.DataSource = bll.GetList(0, _strWhere, _orderby); this.rptList.DataBind(); }
private bool DoEdit(int _id) { bool result = false; BLL.online_service bll = new BLL.online_service(); Model.online_service model = bll.GetModel(_id); model.group_id = int.Parse(ddlGroupId.SelectedValue); model.title = txtTitle.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); model.link_url = txtLinkUrl.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.is_lock = int.Parse(rblIsLock.SelectedValue); if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改在线客服:" + model.title); //记录日志 result = true; } return result; }
private void ShowInfo(int _id) { BLL.online_service bll = new BLL.online_service(); Model.online_service model = bll.GetModel(_id); ddlGroupId.SelectedValue = model.group_id.ToString(); txtTitle.Text = model.title; rblIsLock.SelectedValue = model.is_lock.ToString(); txtSortId.Text = model.sort_id.ToString(); txtLinkUrl.Text = model.link_url; txtImgUrl.Text = model.img_url; }
private void RptBind(string _strWhere, string _orderby) { if (this.group_id > 0) { ddlGroupId.SelectedValue = this.group_id.ToString(); } txtKeywords.Text = this.keywords; BLL.online_service bll = new BLL.online_service(); this.rptList.DataSource = bll.GetList(0, _strWhere, _orderby); this.rptList.DataBind(); }
private bool DoEdit(int _id) { bool result = true; BLL.online_service bll = new BLL.online_service(); Model.online_service model = bll.GetModel(_id); model.group_id = int.Parse(ddlGroupId.SelectedValue); model.title = txtTitle.Text.Trim(); model.img_url = txtImgUrl.Text.Trim(); model.link_url = txtLinkUrl.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.is_lock = int.Parse(rblIsLock.SelectedValue); if (!bll.Update(model)) { result = false; } return result; }