Exemplo n.º 1
0
        private void AddPrice(string acc, int pid)
        {
            if (Request["Isdiscount"] != null)
            {
            }
            else
            {
                bllcprice.DeleteWhere("delete from cprotocolPrice where Accounts='" + acc + "' and cpID=" + pid);
            }
            string html = htmls.Value;

            string[] strs = html.Split(new char[1] {
                ','
            }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string s in strs)
            {
                string[] slist = s.Split(new char[1] {
                    '#'
                }, StringSplitOptions.RemoveEmptyEntries);
                string RoomType               = slist[0];
                string Price                  = slist[1];
                string zdPrice                = slist[2];
                string protoPrice             = slist[3];
                string mothPrice              = slist[4];
                string commission             = slist[5];
                Model.cprotocolPrice modelcp1 = new Model.cprotocolPrice();
                modelcp1.Accounts   = acc;
                modelcp1.RoomType   = Convert.ToInt32(RoomType);
                modelcp1.Price      = Convert.ToInt32(Price);
                modelcp1.protoPrice = Convert.ToInt32(protoPrice);
                modelcp1.mothPrice  = Convert.ToInt32(mothPrice);
                modelcp1.zdPrice    = float.Parse(zdPrice);
                modelcp1.commission = Convert.ToInt32(commission);
                modelcp1.Breakfast  = 0;
                modelcp1.CpID       = pid;
                bllcprice.Add(modelcp1);
            }
        }
Exemplo n.º 2
0
        private void Addcp()
        {
            string Account    = context.Request.QueryString["Account"];
            string RoomType   = context.Request.QueryString["RoomType"];
            string Price      = context.Request.QueryString["Price"];
            string zdPrice    = context.Request.QueryString["zdPrice"];
            string protoPrice = context.Request.QueryString["protoPrice"];
            string mothPrice  = context.Request.QueryString["mothPrice"];
            string commission = context.Request.QueryString["commission"];
            int    pids       = Convert.ToInt32(context.Request.QueryString["pids"]);

            Model.cprotocolPrice modelcp = new Model.cprotocolPrice();
            modelcp.Accounts   = Account;
            modelcp.RoomType   = Convert.ToInt32(RoomType);
            modelcp.Price      = Convert.ToInt32(Price);
            modelcp.protoPrice = Convert.ToInt32(protoPrice);
            modelcp.mothPrice  = Convert.ToInt32(mothPrice);
            modelcp.zdPrice    = Convert.ToInt32(zdPrice);
            modelcp.commission = Convert.ToInt32(commission);
            modelcp.Breakfast  = 0;
            modelcp.CpID       = pids;
            bllcprice.Add(modelcp);
        }