예제 #1
0
        /// <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();
        }