private void BindRep() { string orders = Request.QueryString["orderids"]; rep1.DataSource = bllga.GetModelList1("ga_Type in (8,0,1,9,10,101,11) and ga_occuid='" + orders + "'"); rep1.DataBind(); }
void Yue() { double xiaofei = 0; //消费 double shoukuan = 0; //收款 double yue = 0; //余额 string room1 = context.Request.QueryString["roomNum"].ToString(); int id = fmoc.GetModels(" where room_number='" + room1 + "' and state_id=0 and occ_with='否'").occ_id; string orderid = fmoc.GetModels(" where room_number='" + room1 + "' and state_id=0 and occ_with='否'").order_id; IList <Model.goods_account> list = gmGood.GetModelList1(" ga_occuid='" + orderid + "'"); for (int i = 0; i < list.Count; i++) { xiaofei += Convert.ToDouble((list[i].ga_price)); shoukuan += Convert.ToDouble((list[i].ga_sum_price)); } yue = shoukuan - xiaofei; context.Response.Write(yue); }
/// <summary> /// 帐号 /// </summary> /// <param name="acconut"></param> private void Js(string acconut1) { modelcus = bllcon.GetAccounts(acconut1); List <Model.goods_account> listag = bllga.GetModelList1("ga_Account='" + acconut1 + "'"); if (listag.Count > 0) { foreach (Model.goods_account item in listag) { if (item.ga_Type == 201) { yus += Convert.ToDecimal(item.ga_price); } else if (item.ga_Type == 202) { } else if (item.ga_Type == 203) { yjs += Convert.ToInt32(item.ga_sum_price); if (item.ga_jsfs == 0) { kkjs += Convert.ToInt32(item.ga_sum_price); } } else if (item.ga_Type == 204) { ys += Convert.ToInt32(item.ga_sum_price); } njxf += Convert.ToDecimal(item.ga_sum_price); } } BLL.Commission bllcpp = new BLL.Commission(); List <Model.Commission> listapp = bllcpp.GetModelList("Accounts='" + acconut1 + "'"); if (listapp.Count > 0) { foreach (Model.Commission cp in listapp) { if (cp.IsBack) { commy += Convert.ToInt32(cp.CommSum); } else { commw += Convert.ToInt32(cp.CommSum); } } } ysh.InnerText = ys.ToString();; yush.InnerText = (yus - kkjs).ToString(); yjsh.InnerText = yjs.ToString(); njxfs.InnerText = njxf.ToString(); }
/// <summary> /// 余额 /// </summary> /// <returns></returns> public double GetYE(object OccNo) { double ZongMoney = 0; double shoukuan = 0; double XFMoney = 0; IList <Model.goods_account> list = fmgoods.GetModelList1(" ga_occuid='" + OccNo + "'"); for (int i = 0; i < list.Count; i++) { try { XFMoney += Convert.ToDouble((list[i].ga_price)); shoukuan += Convert.ToDouble((list[i].ga_sum_price)); } catch { } } ZongMoney = XFMoney - shoukuan; return(ZongMoney); }
/// <summary> /// 绑定详情 /// </summary> private void BindXq(int occid) { List <Model.goods_account> list = gabll.GetModelList1("ga_occuid=" + occid + " and ga_Type=111"); if (list != null) { foreach (Model.goods_account item in list) { sb.Append("<tr><td width=\"8%\">" + item.ga_number + "</td><td width=\"28%\">" + item.ga_name + "</td><td width=\"12%\">" + item.ga_unit + "</td><td width=\"12%\" style=\"text-align: right\">" + item.ga_price + "</td><td width=\"16%\"><input type=\"button\" value=\"-\" onclick='jian(this)' class=\"jia reduceProductNumber\" style=\"margin-right: -1px; height: 26px;float:left; margin-left:12px; display:inline\"><input type=\"text\" name=\"RowNumber\" class=\"ProductNumber\" onkeyup='Up(this)' style=\"width: 40px; float:left; height:22px\" value=\"" + item.ga_num + "\"><input type=\"button\" value=\"+\" class=\"jia addProductNumber\" onclick='jia(this)' style=\"margin-left: -1px; height: 26px;float:left\"></td><td width=\"12%\" style=\"text-align: right\" class=\"RowAmount\">" + item.ga_sum_price + "</td><td width=\"12%\"><img src=\"../images/010.gif\" width=\"9\" height=\"9\"><span class=\"STYLE1\">[</span><a href=\"javascript:void(0)\" onclick='clo(this)' class=\"btnRowDelete\">删除</a><span class=\"STYLE1\">]</span></td></tr>"); } } }
public static bool IsJz(string occid) { List <Model.goods_account> listrg = bllga.GetModelList1("ga_occuid='" + occid + "' and ga_sfacount='是' and ga_Type in(6,4)"); if (listrg != null) { if (listrg.Count > 0) { return(true); } } return(false); }
private void isDel() { int id = Convert.ToInt32(context.Request.QueryString["id"]); BLL.goods_account bllga = new BLL.goods_account(); List <Model.goods_account> listga = bllga.GetModelList1("ga_zffs_id=" + id); if (listga.Count > 0) { context.Response.Write("err"); } else { bllmp.Delete(id); context.Response.Write("ok"); } }
/// <summary> /// 撤销结账 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btncxSava_Click(object sender, EventArgs e) { if (ddlState.SelectedValue == "4") { string SQls = "update room_number set Rn_state=2 where Rn_roomNum='" + brBll.GetModel(Convert.ToInt32(txt_room.Value)).room_number + "'"; string strs = "update occu_infor set state_id='0', tuifaId='0',occ_TfTime=null where occ_id=" + txt_room.Value + ""; if (fmroom.Updates(SQls) && brBll.Updates(strs)) { Maticsoft.Common.MessageBox.ShowAndRedirect(this, "撤销挂单成功!", ""); } } else { List <Model.goods_account> listga = bllga.GetModelList1("ga_occuid='" + brBll.GetModel(Convert.ToInt32(txt_room.Value)).order_id + "' and ga_isjz=1"); if (listga != null && listga.Count > 0) { Maticsoft.Common.MessageBox.ShowAndRedirect(this, "已交班不能撤销结账!", ""); } else { string strsql = "update goods_account set ga_sfacount='否' where ga_occuid='" + brBll.GetModel(Convert.ToInt32(txt_room.Value)).order_id + "'"; string SQl = string.Empty; if (rooms.Value != "") { SQl = "update room_number set Rn_state=2 where Rn_roomNum in(" + rooms.Value + ")"; } string strs = "update occu_infor set state_id='0', tuifaId='0' where order_id=" + brBll.GetModel(Convert.ToInt32(txt_room.Value)).order_id + ""; string SQls = "delete from goods_account where ga_Type in(4,6) and ga_occuid='" + brBll.GetModel(Convert.ToInt32(txt_room.Value)).order_id + "'"; if (fmroom.Updates(SQl) && brBll.Updates(strs)) { fmgoods.Updates(strsql); fmgoods.Deletes(SQls); string up = rooms.Value.Replace("'", ""); Helper.AddRoom(brBll.GetModel(Convert.ToInt32(txt_room.Value)).room_number, up + ","); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "撤销结账成功!", ""); } else { Maticsoft.Common.MessageBox.ShowAndRedirect(this, "撤销结账失败!", ""); } } } }
protected void BtnOk_Click(object a, EventArgs e) { for (int i = 0; i < this.rep.Items.Count; i++) { CheckBox check = (CheckBox)this.rep.Items[i].FindControl("cbk"); if (check != null) { if (check.Checked) { HiddenField hidNewsId = this.rep.Items[i].FindControl("hidId") as HiddenField; Model.occu_infor model = blloc.GetModel(Convert.ToInt32(hidNewsId.Value)); List <Model.occu_infor> listiccs = blloc.GetModelList(" order_id='" + model.order_id + "'"); if (listiccs.Count > 0) { foreach (Model.occu_infor item in listiccs) { item.order_id = orderid.Value; item.lordRoomid = loadRoom.Value; blloc.Update(item); } } List <Model.goods_account> listga = bllga.GetModelList1(" ga_occuid=" + model.order_id + ""); foreach (Model.goods_account modelga in listga) { modelga.ga_occuid = orderid.Value; bllga.Update(modelga); } model.lordRoomid = loadRoom.Value; model.order_id = orderid.Value; blloc.Update(model); } } } List <Model.occu_infor> listicc = blloc.GetModelList("order_id='" + orderid.Value + "'"); foreach (Model.occu_infor item in listicc) { sbroom.Append(item.room_number + ","); } Helper.AddRoom(loadRoom.Value, sbroom.ToString() + loadRoom.Value + ","); Response.Write("<script>alert('合并成功!');parent.Window_Close();</script>"); }
/// <summary> /// 绑定 /// </summary> private void Bind() { decimal sumpri = 0.00M; List <Model.book_room> list = bllbr.GetModelList("Book_no='" + bookno + "'"); if (list.Count > 0) { lbname.Text = list[0].book_Name; lbtele.Text = list[0].tele_no; lbdeposit.Text = list[0].deposit.ToString(); } List <Model.goods_account> listga = bllga.GetModelList1("ga_number='" + bookno + "' and ga_name='退订金'"); if (listga != null) { foreach (Model.goods_account model in listga) { sumpri += Convert.ToDecimal(model.ga_price); } } ytuiqian.Text = sumpri.ToString(); }
protected void btnSave_Click(object sender, EventArgs e) { string account = Request.QueryString["accounts"]; decimal pri = Convert.ToDecimal(price.Value); Model.goods_account modelag = new Model.goods_account(); modelag.ga_name = "结账收款"; modelag.Ga_Account = account; modelag.ga_zffs_id = Convert.ToInt32(DDlZffs.SelectedValue); modelag.ga_date = DateTime.Now; modelag.ga_people = UserNow.UserID; modelag.ga_remker = "收款结算"; modelag.ga_Type = 202; modelag.ga_price = pri; if (rad1.Checked) { modelag.ga_jsfs = 0; } else { modelag.ga_jsfs = 1; bllga.Add(modelag); } List <Model.goods_account> listag = bllga.GetModelList1("ga_goodNo in (" + idss.Value + ")"); if (listag.Count > 0) { foreach (Model.goods_account item in listag) { item.ga_Type = 203; bllga.Update(item); } } ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('结帐成功');parent.window.location.reload();</script>"); }
protected void MemberCard_Click(object sender, EventArgs e) { string accountY = account.Value; string accountS = accounts.Value; if (accountS == accountY) { ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>alert('目标客户不能为自己!');</script>"); } else { string goodno = goodnos.Value; List <Model.goods_account> listga = bllga.GetModelList1("ga_goodNo in (" + goodno + ") and ga_Account='" + accountY + "' and ga_Type=204"); if (listga.Count > 0) { foreach (Model.goods_account modelga in listga) { modelga.Ga_Account = accountS; bllga.Update(modelga); } } ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>alert('转帐成功!');</script>"); } }
/// <summary> /// 获得所有的帐单信息 /// </summary> private void AccountS() { Dictionary <string, string> dic = new Dictionary <string, string>(); string account = context.Request.QueryString["account"]; int readvalue = Convert.ToInt32(context.Request.QueryString["readValue"]); string where = string.Empty; List <Model.goods_account> listag = bllga.GetModelList1("ga_Account='" + account + "' and ga_Type=" + readvalue); System.Text.StringBuilder sbtext = new System.Text.StringBuilder(); sbtext.Append("<table cellpadding=\"0\" cellspacing=\"0\" class=\"vip_member\" id=\"tblgood\" style=\"width: 100%\">"); if (readvalue == 201) { sbtext.Append("<tr><th width=\"5%\">选择</th><th width=\"7%\">发生时间</th><th width=\"7%\">帐号</th><th width=\"10%\">客户名称</th><th width=\"7%\">房间号</th><th width=\"8%\">费用名称</th><th width=\"8%\">金额</th><th width=\"8%\">支付方式</th><th width=\"5%\">单据号</th><th width=\"7%\">备注</th><th width=\"7%\">操作人</th></tr>"); } else if (readvalue == 202) { sbtext.Append("<tr><th width=\"5%\">选择</th><th width=\"7%\">发生时间</th><th width=\"7%\">帐号</th><th width=\"10%\">客户名称</th><th width=\"7%\">房间号</th><th width=\"8%\">费用名称</th><th width=\"8%\">支付方式</th><th width=\"8%\">金额</th><th width=\"5%\">单据号</th><th width=\"7%\">备注</th><th width=\"7%\">操作人</th></tr>"); } //else if (readvalue == 203) //{ // sbtext.Append("<tr><th width=\"5%\">选择</th><th width=\"7%\">发生时间</th><th width=\"7%\">帐号</th><th width=\"10%\">客户名称</th><th width=\"7%\">房间号</th><th width=\"8%\">费用名称</th><th width=\"8%\">金额</th><th width=\"5%\">单据号</th><th width=\"7%\">备注</th><th width=\"7%\">操作人</th></tr>"); //} else if (readvalue == 203) { sbtext.Append("<tr><th width=\"5%\">选择</th><th width=\"7%\">发生时间</th><th width=\"7%\">帐号</th><th width=\"10%\">客户名称</th><th width=\"7%\">房间号</th><th width=\"8%\">结算方式</th><th width=\"8%\">金额</th><th width=\"5%\">单据号</th><th width=\"7%\">备注</th><th width=\"7%\">操作人</th></tr>"); string sql = "select ga_goodNo from goods_account where ga_Type=" + readvalue + " and ga_Account='" + account + "' group by ga_goodNo"; DataTable dt = bllga.GetDsBySql(sql); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { string goodNo = dr[0].ToString(); if (!dic.ContainsKey(goodNo)) { dic.Add(goodNo, "ok"); List <Model.goods_account> listga = bllga.GetModelList1("ga_goodNo='" + goodNo + "' and ga_Account='" + account + "'"); sbtext.Append("<tr><td width=\"5%\"><input type=\"checkbox\" class=\"chk\"/><input type=\"hidden\" value=" + goodNo + " class=\"ids\"/></td><td width=\"7%\">" + listga[0].ga_date + "</td><td width=\"7%\">" + listga[0].Ga_Account + "</td><td width=\"10%\">" + GetName(listga[0].Ga_Account) + "</td><td width=\"7%\">" + listga[0].ga_roomNumber + "</td><td width=\"8%\">" + GetJsfs(listga[0].ga_jsfs) + "</td><td width=\"8%\">" + GetSumPrice(goodNo, account, readvalue) + "</td><td width=\"5%\"><a onclick=\"ListBook(this,'" + listga[0].ga_occuid + "','" + goodNo + "')\">" + goodNo + "</a></td><td width=\"7%\">" + listga[0].ga_remker + "</td><td width=\"7%\">" + GetUserName(listga[0].ga_people) + "</td></tr>"); } } } } else if (readvalue == 204) { sbtext.Append("<tr><th width=\"5%\">选择</th><th width=\"7%\">发生时间</th><th width=\"7%\">帐号</th><th width=\"10%\">客户名称</th><th width=\"7%\">房间号</th><th width=\"8%\">金额</th><th width=\"5%\">单据号</th><th width=\"7%\">备注</th><th width=\"7%\">操作人</th><th width=\"7%\">操作</th></tr>"); string sql = "select ga_goodNo from goods_account where ga_Type=" + readvalue + " and ga_Account='" + account + "' group by ga_goodNo"; DataTable dt = bllga.GetDsBySql(sql); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { string goodNo = dr[0].ToString(); if (!dic.ContainsKey(goodNo)) { dic.Add(goodNo, "ok"); List <Model.goods_account> listga = bllga.GetModelList1("ga_goodNo='" + goodNo + "' and ga_Account='" + account + "'"); string sumprice = GetSumPrice(goodNo, account, readvalue); sbtext.Append("<tr><td width=\"5%\"><input type=\"checkbox\" class=\"chk\"/><input type=\"hidden\" value=" + goodNo + " class=\"ids\"/></td><td width=\"7%\">" + listga[0].ga_date + "</td><td width=\"7%\">" + listga[0].Ga_Account + "</td><td width=\"10%\">" + GetName(listga[0].Ga_Account) + "</td><td width=\"7%\">" + listga[0].ga_roomNumber + "</td><td width=\"8%\">" + sumprice + "</td><td width=\"5%\"><a onclick=\"ListBook(this,'" + listga[0].ga_occuid + "','" + goodNo + "')\">" + goodNo + "</a></td><td width=\"7%\">" + listga[0].ga_remker + "</td><td width=\"7%\">" + GetUserName(listga[0].ga_people) + "</td>" + GetStr(Convert.ToDecimal(sumprice), goodNo, listga[0].Ga_Account, listga[0].ga_occuid) + "</tr>"); } } } } if (listag.Count > 0) { foreach (Model.goods_account item in listag) { if (readvalue == 201) { sbtext.Append("<tr><td width=\"5%\"><input type=\"checkbox\" class=\"chk\"/><input type=\"hidden\" value=" + item.id + " class=\"ids\"/></td><td width=\"7%\">" + item.ga_date.ToString() + "</td><td width=\"7%\">" + item.Ga_Account + "</td><td width=\"10%\">" + GetName(item.Ga_Account) + "</td><td width=\"7%\">" + item.ga_roomNumber + "</td><td width=\"8%\">" + item.ga_name + "</td><td width=\"8%\">" + item.ga_price + "</td><td width=\"8%\">" + GetMethPay(Convert.ToInt32(item.ga_zffs_id)) + "</td><td width=\"5%\">" + item.ga_number + "</td><td width=\"7%\">" + item.ga_remker + "</td><td width=\"7%\">" + GetUserName(item.ga_people) + "</td></tr>"); } else if (readvalue == 202) { sbtext.Append("<tr><td width=\"5%\"><input type=\"checkbox\" class=\"chk\"/><input type=\"hidden\" value=" + item.id + " class=\"ids\"/></td><td width=\"7%\">" + item.ga_date.ToString() + "</td><td width=\"7%\">" + item.Ga_Account + "</td><td width=\"10%\">" + GetName(item.Ga_Account) + "</td><td width=\"7%\">" + item.ga_roomNumber + "</td><td width=\"8%\">" + item.ga_name + "</td><td width=\"8%\">" + GetMethPay(Convert.ToInt32(item.ga_zffs_id)) + "</td><td width=\"8%\">" + item.ga_price + "</td><td width=\"5%\">" + item.ga_number + "</td><td width=\"7%\">" + item.ga_remker + "</td><td width=\"7%\">" + GetUserName(item.ga_people) + "</td></tr>"); } //else if ( readvalue == 203) //{ // sbtext.Append("<tr><td width=\"5%\"><input type=\"checkbox\" class=\"chk\"/><input type=\"hidden\" value=" + item.id + " class=\"ids\"/></td><td width=\"7%\">" + item.ga_date.ToString() + "</td><td width=\"7%\">" + item.Ga_Account + "</td><td width=\"10%\">" + GetName(item.Ga_Account) + "</td><td width=\"7%\">" + item.ga_roomNumber + "</td><td width=\"8%\">" + item.ga_name + "</td><td width=\"8%\">" + item.ga_sum_price + "</td><td width=\"5%\">" + item.ga_number + "</td><td width=\"7%\">" + item.ga_remker + "</td><td width=\"7%\">" + GetUserName(item.ga_people) + "</td></tr>"); //} } } sbtext.Append("</table>"); if (listag.Count <= 0) { sbtext.Append("<table><tr><td><span style=\"color:red\">暂无记录!</span></td></tr></table>"); } context.Response.Write(sbtext.ToString()); context.Response.End(); }
private void Bind(string goodno) { BLL.goods_account bllga = new BLL.goods_account(); rep1.DataSource = bllga.GetModelList1("ga_goodNo='" + goodno + "'"); rep1.DataBind(); }