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>");
        }
Beispiel #2
0
 private void Chafeng()
 {
     try
     {
         System.Text.StringBuilder sbtext = new System.Text.StringBuilder();
         string           occno           = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("-", "").Replace(":", "").Replace(" ", "").Replace("/", "");
         int              id       = Convert.ToInt32(context.Request.QueryString["id"]);
         Model.occu_infor modelocc = blloc.GetModel(id);
         if (modelocc.room_number == modelocc.lordRoomid)
         {
             context.Response.Write("err");
             context.Response.End();
         }
         else
         {
             List <Model.occu_infor> listicc = blloc.GetModelList("order_id='" + modelocc.order_id + "'");
             foreach (Model.occu_infor item in listicc)
             {
                 sbtext.Append(item.room_number + ",");
             }
             List <Model.goods_account> listga = bllga.GetModelList1("ga_occuid='" + modelocc.order_id + "' and ga_roomNumber='" + modelocc.room_number + "'");
             if (listga.Count > 0)
             {
                 foreach (Model.goods_account item in listga)
                 {
                     item.ga_occuid = occno;
                     bllga.Update(item);
                 }
             }
             Helper.AddRoom(modelocc.room_number, sbtext.ToString());
             modelocc.order_id   = occno;
             modelocc.GzRoom     = "";
             modelocc.lordRoomid = modelocc.room_number;
             blloc.Update(modelocc);
             context.Response.Write("ok");
             context.Response.End();
         }
     }
     catch (Exception ex)
     {
         throw;
     }
 }