//批次刪除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevelEdit("channel_content", "Edit"); //ChkAdminLevel("plugin_link", TWEnums.ActionEnum.Delete.ToString()); //檢查權限 int sucCount = 0; int errorCount = 0; BLL.basic bll = new BLL.basic(); 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 += 1; } else { errorCount += 1; } } } AddAdminLog(TWEnums.ActionEnum.Delete.ToString(), "刪除問題類型成功" + sucCount + "條,失敗" + errorCount + "條"); //記錄日誌 JscriptMsg("刪除成功" + sucCount + "條,失敗" + errorCount + "條!", Utils.CombUrlTxt("list.aspx", "keywords={0}", this.keywords)); }
private bool DoEdit(int _id) { bool result = false; BLL.basic bll = new BLL.basic(); Model.basic model = bll.GetModel(_id); model.basic_label = txtbasic_label.Text.Trim(); model.basic_sort = int.Parse(txtSortId.Text); if (cbIsLock.Checked) { model.basic_type = "2"; } else { model.basic_type = "1"; } if (bll.Update(model)) { AddAdminLog(TWEnums.ActionEnum.Edit.ToString(), "修改分區設定:" + model.basic_label); //記錄日誌 result = true; } return(result); }
private bool DoAdd() { bool result = false; Model.basic model = new Model.basic(); BLL.basic bll = new BLL.basic(); model.basic_type = txtbasic_type.SelectedValue.Trim(); model.basic_label = txtbasic_label.Text.Trim(); model.basic_sort = int.Parse(txtSortId.Text); model.basic_show = 1; model.basic_where = "city"; int a = bll.Add(model); Model.basic model1 = bll.GetModel(a); if (a > 0) { model1.basic_value = a.ToString(); bll.Update(model1); AddAdminLog(TWEnums.ActionEnum.Add.ToString(), "添加國家設定:" + model.basic_label); //記錄日誌 result = true; } return(result); }
private bool DoAdd() { bool result = false; Model.basic model = new Model.basic(); BLL.basic bll = new BLL.basic(); model.basic_label = txtbasic_label.Text.Trim(); model.basic_sort = int.Parse(txtSortId.Text); model.basic_show = 1; if (cbIsLock.Checked) { model.basic_type = "2"; } else { model.basic_type = "1"; } model.basic_where = "qu"; int a = bll.Add(model); Model.basic model1 = bll.GetModel(a); if (a > 0) { model1.basic_value = a.ToString(); bll.Update(model1); AddAdminLog(TWEnums.ActionEnum.Add.ToString(), "添加分區設定:" + model.basic_label); //記錄日誌 result = true; } return(result); }
private bool DoAdd() { bool result = false; Model.basic model = new Model.basic(); BLL.basic bll = new BLL.basic(); model.basic_label = txtbasic_label.Text.Trim(); model.basic_sort = Utils.StrToInt(txtYun.Text, 0); model.basic_money = Utils.StrToDecimal(txtSortId.Text, 0); model.basic_type = ddlCategoryId.SelectedValue; //model.basic_pic = txtbasic_pic.Text; model.basic_where = "yunfei"; int a = bll.Add(model); Model.basic model1 = bll.GetModel(a); if (a > 0) { model1.basic_value = a.ToString(); bll.Update(model1); AddAdminLog(TWEnums.ActionEnum.Add.ToString(), "添加運費設定:" + model.basic_label); //記錄日誌 result = true; } return(result); }
private void ShowInfo(int _id) { BLL.basic bll = new BLL.basic(); Model.basic model = bll.GetModel(_id); txtSortId.Text = model.basic_money.GetValueOrDefault().ToString("0.00"); txtbasic_label.Text = model.basic_label; txtYun.Text = model.basic_sort.Value.ToString(); ddlCategoryId.SelectedValue = model.basic_type; //txtbasic_pic.Text = model.basic_pic; }
private void ShowInfo(int _id) { BLL.basic bll = new BLL.basic(); Model.basic model = bll.GetModel(_id); txtSortId.Text = model.basic_sort.Value.ToString(); txtbasic_label.Text = model.basic_label; if (model.basic_type == "2") { cbIsLock.Checked = true; } }
private void RptBind(string _strWhere, string _orderby) { this.page = TWRequest.GetQueryInt("page", 1); this.txtKeywords.Text = this.keywords; BLL.basic bll = new BLL.basic(); 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("list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
//批次審核 protected void lbtnUnLock_Click(object sender, EventArgs e) { //ChkAdminLevel("plugin_link", TWEnums.ActionEnum.Audit.ToString()); //檢查權限 BLL.basic bll = new BLL.basic(); 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, "is_lock=0"); } } AddAdminLog(TWEnums.ActionEnum.Audit.ToString(), "審核問題類型"); //記錄日誌 JscriptMsg("批次審核成功!", Utils.CombUrlTxt("list.aspx", "keywords={0}", this.keywords)); }
private bool DoEdit(int _id) { bool result = false; BLL.basic bll = new BLL.basic(); Model.basic model = bll.GetModel(_id); model.basic_type = txtbasic_type.SelectedValue.Trim(); model.basic_label = txtbasic_label.Text.Trim(); model.basic_sort = int.Parse(txtSortId.Text); if (bll.Update(model)) { AddAdminLog(TWEnums.ActionEnum.Edit.ToString(), "修改國家設定:" + model.basic_label); //記錄日誌 result = true; } return(result); }
//儲存排序 protected void btnSave_Click(object sender, EventArgs e) { //ChkAdminLevel("plugin_link", TWEnums.ActionEnum.Edit.ToString()); //檢查權限 BLL.basic bll = new BLL.basic(); 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; } Model.basic model = bll.GetModel(id); model.basic_sort = sortId; bll.Update(model); } AddAdminLog(TWEnums.ActionEnum.Edit.ToString(), "修改問題類型排序:"); //記錄日誌 JscriptMsg("儲存排序成功!", Utils.CombUrlTxt("list.aspx", "keywords={0}", this.keywords)); }
private bool DoEdit(int _id) { bool result = false; BLL.basic bll = new BLL.basic(); Model.basic model = bll.GetModel(_id); model.basic_label = txtbasic_label.Text.Trim(); model.basic_sort = Utils.StrToInt(txtYun.Text, 0); model.basic_money = Utils.StrToDecimal(txtSortId.Text, 0); //model.basic_pic = txtbasic_pic.Text; model.basic_type = ddlCategoryId.SelectedValue; if (bll.Update(model)) { AddAdminLog(TWEnums.ActionEnum.Edit.ToString(), "修改運費設定:" + model.basic_label); //記錄日誌 result = true; } return(result); }
//將excel的資料寫入資料庫 private string InsertGoods(DataTable dt) { string result = ""; BLL.basic bll = new BLL.basic(); Model.basic model = null; //判斷列名是否規範 string[] strColumn = { "分區", "編號", "重量", "費用" }; int num = 0; for (int i = 0; i < dt.Columns.Count; i++) { foreach (string str in strColumn) { if (str == dt.Columns[i].ColumnName) { num++; } } } if (num == strColumn.Length) { //遍歷主件 foreach (DataRow dr in dt.Rows) { if (dr[0].ToString().Trim() != "" && dr[1].ToString().Trim() != "" && dr[2].ToString().Trim() != "" && dr[3].ToString().Trim() != "") { bool update = true; try { model = bll.GetModel(dr[1].ToString()); } catch (Exception eee) { } if (model == null) { model = new Model.basic(); update = false; } model.basic_type = gettype(dr[0].ToString()); model.basic_label = dr[1].ToString(); model.basic_sort = Utils.StrToInt(dr[3].ToString(), 0); model.basic_money = Utils.StrToDecimal(dr[2].ToString(), 0); if (update) { bll.Update(model); } else { model.basic_where = "yunfei"; int a = bll.Add(model); Model.basic model1 = bll.GetModel(a); if (a > 0) { model1.basic_value = a.ToString(); bll.Update(model1); } } } } } else { result = "請檢查excel檔案格式!" + num + strColumn.Length; } return(result); }