Example #1
0
        private bool DoAdd()
        {
            bool result = true;

            Model.customer model = new Model.customer();
            BLL.customer   bll   = new BLL.customer();

            //取得管理员信息
            Model.manager manager = GetAdminInfo();

            model.name             = txtCustomerName.Text.Trim();
            model.scale            = int.Parse(ddlScale.SelectedValue);
            model.vip_level_id     = int.Parse(ddlLevel.SelectedValue);
            model.trade_id         = int.Parse(ddlTrade.SelectedValue);
            model.address          = txtAddress.Text.Trim();
            model.contact_dept     = txtContactDept.Text.Trim();
            model.contact_person   = txtContactPerson.Text.Trim();
            model.contact_telphone = txtContactTelphone.Text.Trim();
            model.creator          = manager.user_name;

            if (bll.Add(model) < 1)
            {
                result = false;
            }
            return(result);
        }
Example #2
0
        /*统计NOshow*/
        void NOshow()
        {
            BLL.book_room          bllbr    = new BLL.book_room();
            Model.SysParamter      modelsys = bllsys.GetModel(1);
            DateTime               dtnow    = DateTime.Now;
            DateTime               dtstart  = Convert.ToDateTime(dtnow.ToString("yyyy-MM-dd")).AddHours(modelsys.YsTime.Hours).AddMinutes(modelsys.YsTime.Minutes).AddSeconds(modelsys.YsTime.Seconds);
            List <Model.book_room> listbr   = bllbr.GetModelList("Accounts!='' and state_id=1");

            if (listbr.Count > 0)
            {
                foreach (Model.book_room item in listbr)
                {
                    TimeSpan tso = Convert.ToDateTime(item.time_to) - Convert.ToDateTime(dtstart);
                    if (tso.TotalSeconds < 0)
                    {
                        Model.customer modelcus = bllcuns.GetAccounts(item.Accounts);
                        if (modelcus != null)
                        {
                            modelcus.NoShow += 1;
                            bllcuns.Update(modelcus);
                        }
                    }
                    item.state_id = 4;
                    bllbr.Update(item);
                }
            }
        }
        private void Bind(string accounts)
        {
            Js(accounts);
            List <Model.customer> list = bllcus.GetModelList("accounts='" + accounts + "'");

            if (list.Count > 0)
            {
                Model.customer modelcus = list[0];
                cName.Value             = modelcus.cName;
                sysType.SelectedValue   = modelcus.sysType.ToString();
                cusType.SelectedValue   = modelcus.cusType.ToString();
                cusDesy.Value           = modelcus.cusDesy;
                cusNumber.Value         = modelcus.cusNumber;
                contacts.Value          = modelcus.contacts;
                cPhone.Value            = modelcus.cPhone;
                Cstate.SelectedValue    = modelcus.Cstate.ToString();
                area.Value              = modelcus.area;
                ybNum.Value             = modelcus.ybNum;
                Address.Value           = modelcus.Address;
                companyPhone.Value      = modelcus.companyPhone;
                Fax.Value               = modelcus.Fax;
                homepage.Value          = modelcus.homepage;
                Csource.SelectedValue   = modelcus.Csource.ToString();
                cIndustry.SelectedValue = modelcus.cindustry.ToString();
                Remark.Value            = modelcus.Remark;
                Ischalk.Checked         = modelcus.Ischalk;
                limit.Value             = modelcus.limit.ToString();
                prosceniumIss.Checked   = modelcus.prosceniumIss;
                Ishire.Checked          = modelcus.Ishire;
                isXz.Checked            = modelcus.IsXz;
            }
        }
Example #4
0
        //取消按钮不做物理删除,改变状态
        protected void Button1_Click(object sender, EventArgs e)
        {
            //改变状态,先写死,到时候再具体看。

            brModel              = brBll.GetModel(Convert.ToInt32(id));
            brModel.state_id     = 5;
            brModel.back_deposit = Convert.ToDecimal(this.txtdeposit.Value);
            //判断退订金不能大于可退订金
            if (Convert.ToDecimal(txtdeposit.Value) > brModel.deposit)
            {
                MessageBox.Show(this, "退订金" + txtdeposit.Value + "不能大于" + brModel.deposit + "可退订金");
                return;
            }
            brModel.meth_pay_id = Convert.ToInt16(meth_payDdl.SelectedValue);
            brModel.remark      = this.txtremark.Value;
            if (brModel.Accounts != "")//如果是单位被取消  增加取消次数
            {
                BLL.customer   bllcuns  = new BLL.customer();
                Model.customer modelcus = bllcuns.GetAccounts(brModel.Accounts);
                if (modelcus != null)
                {
                    modelcus.xqBook += 1;
                    bllcuns.Update(modelcus);
                }
            }
            else
            {
            }
            //写入入账表
            Model.goods_account gaModel = new Model.goods_account();
            gaModel.ga_name = "退订金";
            //gaModel.ga_roomNumber = Convert.ToInt32(brModel.room_number);
            gaModel.ga_zffs_id = Convert.ToInt16(meth_payDdl.SelectedValue);
            gaModel.ga_number  = brModel.book_no;
            gaModel.ga_date    = System.DateTime.Now;
            gaModel.ga_price   = Convert.ToDecimal(txtdeposit.Value) * -1;
            gaModel.ga_people  = UserNow.UserID;
            //gaModel.ga_people = Session["UserId"].ToString();
            gabll.Add(gaModel);

            bool Result = brBll.Update(brModel);
            List <Model.Book_Rdetail> listbr = bllbr.GetListModel("book_no='" + brModel.book_no + "'");

            foreach (Model.Book_Rdetail item in listbr)
            {
                item.RoomTypeID = 5;
                bllbr.Update(item);
            }
            if (Result == true)
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "info", "<script language=\"javascript\">if(confirm('取消预定成功!是否打印退款单?')){ ShowDivs(this,'" + brModel.book_no + "') }else{ ShowTabs('预定管理');}</script>");
                //Response.Redirect("BookList.aspx");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(GetType(), "info", "<script>alert('取消失败!');parent.Window_Close();</script>");
                //Response.Redirect("BookList.aspx");
            }
        }
Example #5
0
 private void Bind(string account)
 {
     Accounts.InnerText = account;
     Model.customer model = bllcus.GetAccounts(account);
     if (model != null)
     {
         cusDesy.InnerText = model.cusDesy;
     }
 }
Example #6
0
        /// <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();
        }
Example #7
0
 protected string GetXieYi(string account)
 {
     BLL.customer   bllcus   = new BLL.customer();
     Model.customer modelcus = bllcus.GetAccounts(account);
     if (modelcus != null)
     {
         return(modelcus.cName);
     }
     return("");
 }
Example #8
0
        private void add(Model.customer account)
        {
            var viwer = new Customer.Viwer();

            viwer.id      = account.id;
            viwer.name    = account.name;
            viwer.address = account.address;
            //viwer.panno = account.panno;
            viwer.phone = account.phone;
            //viwer.due = account.currentdue.Value;
            //viwer.advance = account.currentadvance.Value;
            viwer.Dock = DockStyle.Top;
            flowLayoutPanel1.Controls.Add(viwer);
        }
Example #9
0
        private void ShowInfo(int _id)
        {
            BLL.customer   bll   = new BLL.customer();
            Model.customer model = bll.GetModel(_id);

            txtCustomerName.Text    = model.name;
            ddlScale.SelectedValue  = model.scale.ToString();
            ddlTrade.SelectedValue  = model.trade_id.ToString();
            ddlLevel.SelectedValue  = model.vip_level_id.ToString();
            txtAddress.Text         = model.address;
            txtContactDept.Text     = model.contact_dept;
            txtContactPerson.Text   = model.contact_person;
            txtContactTelphone.Text = model.contact_telphone;
        }
Example #10
0
        private void GetisOk()
        {
            string account = context.Request.QueryString["accout"];
            int    ys      = 0;
            List <Model.goods_account> listag = bllga.GetModelList1("ga_Account='" + account + "'");

            if (listag.Count > 0)
            {
                foreach (Model.goods_account item in listag)
                {
                    if (item.ga_Type == 204)
                    {
                        ys += Convert.ToInt32(item.ga_sum_price);
                    }
                }
            }
            string d = context.Request.QueryString["price"];

            Model.customer       modelcus = bllcus.GetAccounts(account);
            string               msg      = string.Empty;
            JavaScriptSerializer js       = new JavaScriptSerializer();

            if (modelcus.Ischalk)
            {
                var obj = new { statu = "err", msg = "止单位不允许记帐!" };
                msg = js.Serialize(obj);
            }
            else
            {
                if (modelcus.IsXz)
                {
                    if (Convert.ToDecimal(d) + ys > modelcus.limit)
                    {
                        var obj = new { statu = "err", msg = "已超过最大记帐值!" };
                        msg = js.Serialize(obj);
                    }
                    else
                    {
                        var obj = new { statu = "ok", msg = "成功!" };
                        msg = js.Serialize(obj);
                    }
                }
                else
                {
                    var obj = new { statu = "ok", msg = "成功!" };
                    msg = js.Serialize(obj);
                }
            }
            context.Response.Write(msg);
        }
Example #11
0
        /*
         * /// <summary>
         * /// 分页获取数据列表
         * /// </summary>
         * public DataSet GetList(int PageSize,int PageIndex,string strWhere)
         * {
         *  SqlParameter[] parameters = {
         *          new SqlParameter("@tblName", SqlDbType.VarChar, 255),
         *          new SqlParameter("@fldName", SqlDbType.VarChar, 255),
         *          new SqlParameter("@PageSize", SqlDbType.Int),
         *          new SqlParameter("@PageIndex", SqlDbType.Int),
         *          new SqlParameter("@IsReCount", SqlDbType.Bit),
         *          new SqlParameter("@OrderType", SqlDbType.Bit),
         *          new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
         *          };
         *  parameters[0].Value = "customer";
         *  parameters[1].Value = "ID";
         *  parameters[2].Value = PageSize;
         *  parameters[3].Value = PageIndex;
         *  parameters[4].Value = 0;
         *  parameters[5].Value = 0;
         *  parameters[6].Value = strWhere;
         *  return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
         * }*/

        #endregion  BasicMethod
        #region  ExtensionMethod

        #endregion  ExtensionMethod


        public Model.customer GetAccounts(string accounts)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select ID,accounts,cName,sysType,cusType,cusDesy,cusNumber,contacts,cPhone,Cstate,sales,prosceniumIss,Ishire,area,City,Contsrr,Shiji,Email,ybNum,Address,companyPhone,Fax,homepage,Csource,cindustry,Ischalk,limit,Remark,AddDate,editUser,verifyUser,isVerify,Hotel,Details,occNum,NoShow,xqBook,Pming,IsXz  ");
            strSql.Append(" FROM customer where accounts='" + accounts + "'");
            DataSet ds = DbHelperSQL.Query(strSql.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                Model.customer modelcus = DataRowToModel(ds.Tables[0].Rows[0]);
                return(modelcus);
            }
            return(null);
        }
Example #12
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Model.customer model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update gm_dt_customer_base set ");
            strSql.Append("name=@name,");
            strSql.Append("scale=@scale,");
            strSql.Append("trade_id=@trade_id,");
            strSql.Append("address=@address,");
            strSql.Append("vip_level_id=@vip_level_id,");
            strSql.Append("contact_person=@contact_person,");
            strSql.Append("contact_dept=@contact_dept,");
            strSql.Append("contact_telphone=@contact_telphone");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@name",             SqlDbType.NVarChar, 100),
                new SqlParameter("@scale",            SqlDbType.Int,        4),
                new SqlParameter("@trade_id",         SqlDbType.Int,        4),
                new SqlParameter("@address",          SqlDbType.NVarChar, 100),
                new SqlParameter("@vip_level_id",     SqlDbType.Int,        4),
                new SqlParameter("@contact_person",   SqlDbType.NVarChar, 100),
                new SqlParameter("@contact_dept",     SqlDbType.NVarChar, 100),
                new SqlParameter("@contact_telphone", SqlDbType.NVarChar, 100),
                new SqlParameter("@id",               SqlDbType.Int, 4)
            };
            parameters[0].Value = model.name;
            parameters[1].Value = model.scale;
            parameters[2].Value = model.trade_id;
            parameters[3].Value = model.address;
            parameters[4].Value = model.vip_level_id;
            parameters[5].Value = model.contact_person;
            parameters[6].Value = model.contact_dept;
            parameters[7].Value = model.contact_telphone;
            parameters[8].Value = model.id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #13
0
        /// <summary>
        /// 查询是否有多个
        /// </summary>
        private void IsChild()
        {
            string accounts = context.Request.QueryString["accounts"];
            List <Model.cprotocol> listcpo = bllcpo.GetModelList("Accounts='" + accounts + "'");

            if (listcpo.Count > 0)
            {
                string str = js.Serialize(listcpo);
                Common.AjaxMsgHelper.AjaxMsg1("ok", "", str, "");
            }
            else
            {
                Model.customer modelcus = bllcus.GetAccounts(accounts);
                string         str      = js.Serialize(modelcus);
                Common.AjaxMsgHelper.AjaxMsg1("err", "", str, "");
            }
        }
Example #14
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Model.customer model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into gm_dt_customer_base(");
            strSql.Append("name,scale,trade_id,address,vip_level_id,contact_person,contact_dept,contact_telphone,creator)");
            strSql.Append(" values (");
            strSql.Append("@name,@scale,@trade_id,@address,@vip_level_id,@contact_person,@contact_dept,@contact_telphone,@creator)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@name",             SqlDbType.NVarChar, 100),
                new SqlParameter("@scale",            SqlDbType.Int,        4),
                new SqlParameter("@trade_id",         SqlDbType.Int,        4),
                new SqlParameter("@address",          SqlDbType.NVarChar, 100),
                new SqlParameter("@vip_level_id",     SqlDbType.Int,        4),
                new SqlParameter("@contact_person",   SqlDbType.NVarChar, 100),
                new SqlParameter("@contact_dept",     SqlDbType.NVarChar, 100),
                new SqlParameter("@contact_telphone", SqlDbType.NVarChar, 100),
                new SqlParameter("@creator",          SqlDbType.NVarChar, 50)
            };
            parameters[0].Value = model.name;
            parameters[1].Value = model.scale;
            parameters[2].Value = model.trade_id;
            parameters[3].Value = model.address;
            parameters[4].Value = model.vip_level_id;
            parameters[5].Value = model.contact_person;
            parameters[6].Value = model.contact_dept;
            parameters[7].Value = model.contact_telphone;
            parameters[8].Value = model.creator;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Example #15
0
 public override void SonLoad()
 {
     if (!IsPostBack)
     {
         BindCall();
         BindcDepartment();
         BindcPost();
         Accounts.Value = Request.QueryString["accounts"];
         Model.customer model = bllcus.GetAccounts(Accounts.Value);
         if (model != null)
         {
             cusDesy.InnerText = model.cusDesy;
         }
         if (Request.QueryString["type"] == "edit")
         {
             BtnSave.Value = "更新客户";
             BindInfo();
         }
     }
 }
Example #16
0
        private bool DoEdit(int _id)
        {
            bool result = true;

            BLL.customer   bll   = new BLL.customer();
            Model.customer model = bll.GetModel(_id);

            model.name             = txtCustomerName.Text.Trim();
            model.scale            = int.Parse(ddlScale.SelectedValue);
            model.vip_level_id     = int.Parse(ddlLevel.SelectedValue);
            model.trade_id         = int.Parse(ddlTrade.SelectedValue);
            model.address          = txtAddress.Text.Trim();
            model.contact_dept     = txtContactDept.Text.Trim();
            model.contact_person   = txtContactPerson.Text.Trim();
            model.contact_telphone = txtContactTelphone.Text.Trim();

            if (!bll.Update(model))
            {
                result = false;
            }

            return(result);
        }
 /// <summary>
 /// 协议入住费用转
 /// </summary>
 private void XieYi()
 {
     if (accounts.Value != "")   //如果是协议单位入住,更新入住天数    并要把设置计算佣金
     {
         Model.occu_infor modelocc = fmOc.GetModel(ids);
         TimeSpan         ts       = Convert.ToDateTime(modelocc.depar_time) - Convert.ToDateTime(modelocc.occ_time);
         int mydays = ts.Days;
         if (mydays <= 0)
         {
             mydays = 1;
         }
         Model.customer modelcus = bllcus.GetAccounts(accounts.Value);
         modelcus.occNum += mydays;
         bllcus.Update(modelcus);
         /*计算佣金*/
         string accou = account.Value;
         if (modelocc.CpID != null)
         {
             Model.cprotocol modelcp = bllcp.GetModel(Convert.ToInt32(modelocc.CpID));
             if (modelcp != null)
             {
                 bool dayhire    = modelcp.Dayhire;                     //是否每日计佣
                 int  Commission = Convert.ToInt32(modelcp.Commission); //佣金
                 bool ishire     = modelcp.ishire;                      //是否按房类计佣
                 int  day        = ts.Days;
                 int  sum        = 0;                                   //总佣金
                 if (ishire)                                            //如果 是按房类记算佣金
                 {
                     BLL.cprotocolPrice          bllcpp  = new BLL.cprotocolPrice();
                     List <Model.cprotocolPrice> listcpp = bllcpp.GetModelList("cpID=" + modelcp.ID + " and RoomType=" + modelocc.real_type_id);
                     if (listcpp.Count > 0)
                     {
                         Commission = Convert.ToInt32(listcpp[0].commission);
                     }
                 }
                 if (dayhire)
                 {
                     sum = Commission * day;
                 }
                 else
                 {
                     sum = Commission;
                 }
                 BLL.Commission   bllcomm   = new BLL.Commission();
                 Model.Commission modelcomm = new Model.Commission();
                 modelcomm.Accounts   = accounts.Value;
                 modelcomm.CommDesp   = "";
                 modelcomm.CommDate   = DateTime.Now;
                 modelcomm.CommSum    = sum;
                 modelcomm.IsBack     = false;
                 modelcomm.GoodNumber = modelocc.occ_no;
                 modelcomm.IsEveryDay = modelcp.Dayhire;
                 modelcomm.DayComm    = modelcp.Commission;
                 modelcomm.CommRemark = "";
                 bllcomm.Add(modelcomm);
             }
         }
     }
     if (idids.Value != "")   //如果是协议单位
     {
         List <Model.goods_account> listga = bllga.GetModelList1("ID in (" + idids.Value + ")");
         if (listga.Count > 0)
         {
             foreach (Model.goods_account item in listga)
             {
                 item.Ga_Account = account.Value;
                 item.ga_Type    = 204;
                 bllga.Update(item);
             }
         }
     }
 }
        /// <summary>
        /// 保存和修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void BtnSave_Click(object sender, EventArgs e)
        {
            Model.customer modelcus = new Model.customer();
            double         i        = r.NextDouble();
            string         str      = i.ToString().Substring(2, 5);

            modelcus.accounts      = "A" + str;
            modelcus.cName         = cName.Value;
            modelcus.sysType       = Convert.ToInt32(sysType.SelectedValue);
            modelcus.cusType       = Convert.ToInt32(cusType.SelectedValue);
            modelcus.cusDesy       = cusDesy.Value;
            modelcus.cusNumber     = cusNumber.Value;
            modelcus.contacts      = contacts.Value;
            modelcus.cPhone        = cPhone.Value;
            modelcus.Cstate        = Convert.ToInt32(Cstate.SelectedValue);
            modelcus.sales         = 1;
            modelcus.prosceniumIss = prosceniumIss.Checked;
            modelcus.Ishire        = Ishire.Checked;
            modelcus.area          = area.Value;
            modelcus.ybNum         = ybNum.Value;
            modelcus.Email         = Email.Value;
            modelcus.Address       = Address.Value;
            modelcus.companyPhone  = companyPhone.Value;
            modelcus.Fax           = Fax.Value;
            modelcus.homepage      = homepage.Value;
            modelcus.Csource       = Convert.ToInt32(Csource.SelectedValue);
            modelcus.cindustry     = Convert.ToInt32(cIndustry.SelectedValue);
            modelcus.Ischalk       = Ischalk.Checked;
            if (limit.Value == "")
            {
                modelcus.limit = null;
            }
            else
            {
                modelcus.limit = Convert.ToInt32(limit.Value);
            }
            modelcus.Remark     = Remark.Value;
            modelcus.AddDate    = DateTime.Now;
            modelcus.editUser   = UserNow.UserID;
            modelcus.verifyUser = null;
            modelcus.isVerify   = false;
            modelcus.Details    = "";
            modelcus.IsXz       = isXz.Checked;
            if (Request.QueryString["type"] == "edit")
            {
                modelcus.accounts = acc.Value;
                if (bllcus.Update(modelcus))
                {
                    ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'>alert('更新成功');parent.window.location.reload();</script>");
                }
            }
            else
            {
                modelcus.occNum = 0;
                modelcus.NoShow = 0;
                modelcus.xqBook = 0;
                modelcus.Pming  = 0;
                if (bllcus.Add(modelcus) > 0)
                {
                    ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'>alert('新增成功');parent.window.location.reload();</script>");
                }
            }
        }
Example #19
0
 /*This function inserts a customer to the database*/
 public void InsertCustomer(string pnr, string custName, string custSurName, string custEmail,
                             int custPhone)
 {
     Model.customer cust = new Model.customer();
     cust.pnr = pnr;
     cust.forename = custName;
     cust.surname = custSurName;
     cust.email = custEmail;
     cust.phonenumber = custPhone;
     db.customers.InsertOnSubmit(cust);
     db.SubmitChanges();
 }
Example #20
0
        public override void SonLoad()
        {
            Model.SysParamter modelsys = bllsys.GetModel(1);
            isok.Value = modelsys.IsCy.ToString();
            RoomTypeDdl.Attributes.Add("onchange", "selectChange(this)");
            if (!IsPostBack)
            {
                GuestSourceData();
                MethPayData();
                RoomTypeData();
                //BindHouseNumber();
                HouseShameData();
                RealPrice();
                BindOkNum(Convert.ToInt32(this.RoomTypeDdl.SelectedValue));
                maxNum.InnerText = BindMaxNum(Convert.ToInt32(this.RoomTypeDdl.SelectedValue));
                string type = Request.QueryString["type"].ToString();
                if (type == "add")
                {
                    lblmsg.Text = "新增";
                }
                else if (type == "edit")
                {
                    lblmsg.Text        = "修改";
                    deposit.Disabled   = true;
                    BookAddButton.Text = "更新";
                    id                = Convert.ToInt32(Request.QueryString["id"].ToString());
                    nowModel          = bllbr.GetModel(id);
                    book_no_hid.Value = nowModel.book_no;
                    //通过ID获得实体,然后为控件赋值
                    book_name.Value              = nowModel.book_Name;
                    tele_no.Value                = nowModel.tele_no;
                    onli_no.Value                = nowModel.onli_no;
                    real_time.Value              = nowModel.time_to.ToString();
                    time_from.Value              = Convert.ToDateTime(nowModel.time_from).ToString();
                    time_to.Value                = Convert.ToDateTime(nowModel.real_time).ToString("yyyy-MM-dd");
                    mem_cardNo.Value             = nowModel.mem_cardno;
                    GuarWayDll.SelectedValue     = nowModel.guar_way;
                    GuestSourceDdl.SelectedValue = nowModel.source_id.ToString();
                    MethPayDdl.SelectedValue     = nowModel.meth_pay_id.ToString();
                    deposit.Value                = nowModel.deposit.ToString();
                    textRemaker.Value            = nowModel.remark;
                    if (nowModel.Accounts != "" && nowModel.Accounts != null)
                    {
                        BLL.customer bllcus = new BLL.customer();
                        accounts.Value = nowModel.Accounts;//协议单位编号
                        CpId.Value     = nowModel.CpID.ToString();
                        Model.customer modelcus = bllcus.GetAccounts(nowModel.Accounts);
                        customer.Value = modelcus.cName;
                    }
                    Dictionary <int, string>  dic    = new Dictionary <int, string>();
                    List <Model.Book_Rdetail> listbr = bllrd.GetListModel("Book_no='" + nowModel.book_no + "'");

                    foreach (Model.Book_Rdetail item in listbr)
                    {
                        if (dic.ContainsKey(item.Real_type_Id))
                        {
                            continue;
                        }
                        dic.Add(item.Real_type_Id, "true");
                        List <Model.Book_Rdetail> lists = listbr.Where(d => d.Real_type_Id == item.Real_type_Id).ToList();
                        if (lists.Count > 1)
                        {
                            //item = lists[0];
                        }
                        sbDel.Append("<tr class=\"tr\"><td class=\"w30\"><span>房 型:</span></td>");
                        sbDel.Append("<td class=\"w70\"><select name=\"RoomTypeDdl\" id=\"RoomTypeDdl\" onchange=\"selectChange(this)\">");
                        GetAllType(item);
                        sbDel.Append("</select></td>");
                        sbDel.Append("<td class=\"w30\">");
                        sbDel.Append("<span>方 案:</span>");
                        sbDel.Append("</td>");
                        sbDel.Append("<td class=\"w70\">");
                        sbDel.Append("<select name=\"HouseShameDdl\" id=\"HouseShameDdl\">");
                        GetAllYh(item);
                        sbDel.Append("</select>");
                        sbDel.Append("</td>");
                        sbDel.Append("<td class=\"w30\">");
                        sbDel.Append("<span>房 价:</span>");
                        sbDel.Append("</td>");

                        sbDel.Append("<td class=\"w70\">");
                        sbDel.Append("<input name=\"real_price\" type=\"text\" id=\"real_price\" class=\"txtprice\" value=\"" + item.Real_Price + "\">");
                        sbDel.Append("</td>");
                        sbDel.Append("<td class=\"w70\">可预定数:<span  id=\"txtOkNum\" runat=\"server\" class=\"txtprice\"  >" + BindOkNum1(item.Real_type_Id) + "</span><span runat=\"server\" id=\"maxNum\" style=\" display:none;\">" + BindMaxNum(item.Real_type_Id) + "</span></td>");
                        sbDel.Append("<td class=\"w50\">");
                        sbDel.Append("<span>房间数量:</span>");
                        sbDel.Append("</td>");
                        sbDel.Append("<td class=\"w\" style=\"width:220px;\">");
                        sbDel.Append("<p onclick=\"SaleRealNum(this)\" class=\"jians\">");
                        sbDel.Append("-</p>");
                        sbDel.Append("<p style=\"float: left;\">");
                        if (lists.Count > 1)
                        {
                            sbDel.Append("  <input name=\"real_num\" type=\"text\" id=\"real_num\" value=\"" + lists.Count + "\" class=\"number fjslInp\"></p>");
                        }
                        else
                        {
                            sbDel.Append("  <input name=\"real_num\" type=\"text\" id=\"real_num\" value=\"" + item.Real_num + "\" class=\"number fjslInp\"></p>");
                        }
                        sbDel.Append("<p onclick=\"addRealNum(this)\" class=\"jia\">");
                        sbDel.Append("     +</p>");
                        sbDel.Append(" <p onclick=\"funAddTable()\" class=\"addBook\">");
                        sbDel.Append("       添加</p>");
                        sbDel.Append("  <p class=\"delBook\" onclick=\"DelTr(this)\">");
                        sbDel.Append("      删除</p>");
                        sbDel.Append("</td>");
                        sbDel.Append(" <td class=\"w30\">");
                        sbDel.Append("     <span>房 号:</span>");
                        sbDel.Append("   </td>");
                        sbDel.Append("   <td class=\"w30\" style=\"width:60px;\">");
                        if (lists.Count > 1)
                        {
                            sbDel.Append("     <span id=\"fh\">" + Geta(lists) + "</span><span class=\"yffh addBook\" onclick=\"ShowDiog(this)\" style=\" cursor:pointer;\">预 分</span>");
                        }
                        else
                        {
                            sbDel.Append("     <span id=\"fh\"><a>" + item.Room_number + "</a></span><span class=\"yffh addBook\" onclick=\"ShowDiog(this)\" style=\" cursor:pointer;\">预 分</span>");
                        }
                        sbDel.Append("     </td>");
                        sbDel.Append("    <td class=\"w70\">");
                        sbDel.Append("       <span id=\"HouseNumDdl\"></span>");
                        sbDel.Append("   </td>");
                        sbDel.Append("  </tr>");
                    }
                    if (Request["isok"] != null)
                    {
                        bool b = Convert.ToBoolean(Request["isok"]);
                        if (b)
                        {
                            BookAddButton.Style.Add("display", "none");
                        }
                    }
                }
            }
        }
Example #21
0
 private void Newitem_savedata(Model.customer account)
 {
     add(account);
 }
Example #22
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Model.customer model)
 {
     return(dal.Update(model));
 }
Example #23
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Model.customer model)
 {
     return(dal.Add(model));
 }