//#region 增加操作================================= //private bool DoAdd() //{ // tbl_reg_jiebie model = new tbl_reg_jiebie(); // if (model.Exists(txttitle.Text.Trim())) // { // mym.JscriptMsg(this.Page, "您输入的级别名称已经存在,请检查!", "", "Error"); // return false; // } // if (model.Exists_jb_value(int.Parse(txt_fuzhi.Text.Trim()))) // { // mym.JscriptMsg(this.Page, "您输入的级别赋值已经存在,请检查!", "", "Error"); // return false; // } // model.jiebie_name = txttitle.Text.Trim(); // model.jiebie_value =int.Parse(txt_fuzhi.Text.Trim()); // model.need_money =decimal.Parse(txt_money.Text.Trim()); // model.sort_id = int.Parse(txtSortId.Text.Trim()); // if (cbIsLock.Checked == true) // { // model.show_flag = 1; // } // else // { // model.show_flag = 0; // } // if (model.Add() > 0) // { // // mym.AddAdminLog("增加", "添加商品类别:" + txttitle.Text); //记录日志 // return true; // } // return false; //} //#endregion #region 修改操作================================= private bool DoEdit(int _id) { bool result = false; tbl_machine model1 = new tbl_machine(); //tbl_reg_jiebie model = new tbl_reg_jiebie(); //if (model.Exists(txttitle.Text.Trim(), _id)) //{ // mym.JscriptMsg(this.Page, "您输入的级别名称已经存在,请检查!", "", "Error"); // return false; //} //if (model.Exists_jb_value(int.Parse(txt_fuzhi.Text.Trim()), _id)) //{ // mym.JscriptMsg(this.Page, "您输入的级别赋值已经存在,请检查!", "", "Error"); // return false; //} model1.GetModel(_id); model1.percent = decimal.Parse(txt_percent.Text.Trim()); model1.price = decimal.Parse(txt_money.Text.Trim()); model1.date = Convert.ToInt32(txt_date.Text.Trim()); //model.need_money =txt_money.Text.Trim(); //model.sort_id = int.Parse(txtSortId.Text.Trim()); //if (cbIsLock.Checked == true) //{ // model.show_flag = 1; //} //else //{ // model.show_flag = 0; //} //if (model.Update()) //{ // // mym.AddAdminLog("修改", "修改商品类别:" + txttitle.Text); //记录日志 // result = true; //} model1.Update(); return(result); }
private void ShowInfo(int _id) { //tbl_reg_jiebie model = new tbl_reg_jiebie(); //model.GetModel(_id); tbl_machine model = new tbl_machine(); model.GetModel(_id); txt_percent.Text = model.percent.ToString(); txt_money.Text = model.price.ToString(); txt_date.Text = model.date.ToString(); //txtSortId.Text = model.sort_id.ToString(); //if (model.show_flag == 0) //{ // cbIsLock.Checked = false; //} //else //{ // cbIsLock.Checked = true; //} }