private void btn_save(object sender, EventArgs e) { DevExpress.XtraEditors.SimpleButton simpbtn = (DevExpress.XtraEditors.SimpleButton)sender; if (simpbtn.Tag.Equals("Simbtn_save_basic")) { if (!txt_jdmc.Text.Equals(common_file.common_app.qymc) || !txt_yydh.Text.Equals(common_file.common_app.yydh) || !txt_SoftName.Text.Equals(common_file.common_app.SoftName)) { common_file.common_app.get_czsj(); Model.Xqyxx qyxx = new Hotel_app.Model.Xqyxx(); BLL.Xqyxx bll = new Hotel_app.BLL.Xqyxx(); List <Model.Xqyxx> list = bll.GetModelList(" id>=0 and yydh='" + common_file.common_app.yydh + "'"); if (list != null && list.Count > 0) { qyxx = list[0]; int id = qyxx.id; qyxx.qymc = txt_jdmc.Text; qyxx.yydh = txt_yydh.Text; qyxx.Softname = txt_SoftName.Text; qyxx.id = id; if (bll.Update(qyxx)) { common_file.common_app.Message_box_show(common_file.common_app.message_title, "更新酒店基本信息成功"); } } } } if (simpbtn.Tag.Equals("Simbtn_save_zdInfo")) { if (!cb_jzd.SelectedItem.Equals(jzd_now) || !cb_yjd.SelectedItem.Equals(yjd_now) || !cb_djb.SelectedItem.Equals(djb_now) || !txt_yqsts.Value.Equals(tqts)) { jzd_now = cb_jzd.Text.Equals("A4") ? "11" : "21"; yjd_now = cb_yjd.Text.Equals("A4") ? "11" : "21"; djb_now = cb_djb.Text.Equals("A4") ? "11" : "21"; BLL.Qcounter bll = new Hotel_app.BLL.Qcounter(); Model.Qcounter counter = new Hotel_app.Model.Qcounter(); List <Model.Qcounter> list = bll.GetModelList(" id>=0 and yydh='" + common_file.common_app.yydh + "'"); if (list != null && list.Count > 0) { counter = list[0]; int id = counter.ID; counter.printzdpd = int.Parse(jzd_now + yjd_now + djb_now); counter.ID = id; if (bll.Update(counter)) { common_file.common_app.Message_box_show(common_file.common_app.message_title, "更新成功,你现在可以直接连接打印机打印您设置的账单"); } } } } }
public string Xqyxx_add_edit(string id, string yydh, string qymc, string zjm, string qybh, string qydh, string qycz, string email, string nxr, string qydz, string add_edit_delete, string xxzs) { string s = common_file.common_app.get_failure; BLL.Xqyxx B_Xqyxx = new Hotel_app.BLL.Xqyxx(); Model.Xqyxx M_Xqyxx = new Hotel_app.Model.Xqyxx(); if (xxzs == common_file.common_app.xxzs_xxvalue) { } if (xxzs == common_file.common_app.xxzs_zsvalue) { } if (add_edit_delete == common_file.common_app.get_add) { M_Xqyxx.yydh = yydh; M_Xqyxx.qymc = qymc; M_Xqyxx.zjm = zjm; M_Xqyxx.qybh = qybh; M_Xqyxx.qydh = qydh; M_Xqyxx.qycz = qycz; M_Xqyxx.Email = email; M_Xqyxx.nxr = nxr; M_Xqyxx.qydz = qydz; if (B_Xqyxx.Add(M_Xqyxx) > 0) { s = common_file.common_app.get_suc; } } else if (add_edit_delete == common_file.common_app.get_edit) { M_Xqyxx = B_Xqyxx.GetModel(Convert.ToInt32(id)); M_Xqyxx.zjm = zjm; M_Xqyxx.qybh = qybh; M_Xqyxx.qydh = qydh; M_Xqyxx.qycz = qycz; M_Xqyxx.Email = email; M_Xqyxx.nxr = nxr; M_Xqyxx.qydz = qydz; if (B_Xqyxx.Update(M_Xqyxx)) { s = common_file.common_app.get_suc; } } else if (add_edit_delete == common_file.common_app.get_delete) { if (id != "") { B_Xqyxx.Delete(Convert.ToInt32(id)); s = common_file.common_app.get_suc; } } return(s); }