Esempio n. 1
0
        /// <summary>
        /// 保存
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdds_Click(object sender, EventArgs e)
        {
            string no = "CZ" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("-", "").Replace(":", "").Replace(" ", "").Replace("/", "");

            CdHotelManage.Model.goods_account model = new CdHotelManage.Model.goods_account();
            CdHotelManage.BLL.goods_account   bll   = new CdHotelManage.BLL.goods_account();
            model.ga_number    = DDlName.SelectedValue;
            model.ga_name      = DDlName.SelectedItem.Text;
            model.ga_Type      = 204;
            model.ga_price     = 0;
            model.ga_sum_price = Convert.ToDecimal(txt_Money.Value);
            model.ga_date      = Convert.ToDateTime(System.DateTime.Now);
            model.ga_people    = UserNow.UserID;
            model.ga_sfacount  = "否";
            model.ga_remker    = txt_Remaker.Value;
            model.Ga_Account   = ga_Account.Text;
            model.Ga_goodNo    = no;
            int Result = bll.Add(model);

            if (Result > 0)
            {
                ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('保存成功');parent.window.location.href='account_goods.aspx?readValue=204&accounts=" + ga_Account.Text + "';</script>");
            }
            else
            {
                Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存失败!", "");
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdds_Click(object sender, EventArgs e)
        {
            try
            {
                CdHotelManage.Model.goods_account model = new CdHotelManage.Model.goods_account();
                CdHotelManage.BLL.goods_account   bll   = new CdHotelManage.BLL.goods_account();
                Model.occu_infor Ocmodels = new Model.occu_infor();
                Ocmodels.state_id     = 1;
                Ocmodels.continuelive = ids;
                Ocmodels.brithday     = Convert.ToDateTime(fmrzInfo.GetModel(ids).brithday).ToString();
                Ocmodels.occ_time     = System.DateTime.Now;
                Ocmodels.depar_time   = Convert.ToDateTime(txt_ydDate.Value);
                Ocmodels.pha_sched    = Convert.ToDateTime(txt_xdDate.Value);
                Ocmodels.deposit      = Convert.ToDecimal(txt_yjMoney.Value);
                Ocmodels.stay_day     = Convert.ToInt32(txt_liveDay.Value);
                Ocmodels.meth_pay_id  = Convert.ToInt32(DDlZffs.SelectedValue);
                model.ga_number       = ids.ToString();
                model.ga_Type         = 3;
                model.ga_name         = "续住收款";
                model.ga_number       = ids.ToString();
                model.ga_price        = Convert.ToDecimal(txt_yjMoney.Value);
                model.ga_sum_price    = 0;
                model.ga_date         = Convert.ToDateTime(System.DateTime.Now);
                model.ga_occuid       = fmrzInfo.GetModel(ids).order_id;
                model.ga_people       = UserNow.UserID;
                model.ga_sfacount     = "否";
                model.ga_remker       = txt_Remaker.Value;
                model.Ga_goodNo       = fmrzInfo.GetModel(ids).occ_no;
                model.ga_zffs_id      = Convert.ToInt32(DDlZffs.SelectedValue);
                model.ga_roomNumber   = fmrzInfo.GetModel(ids).room_number;
                int Result = bll.Add(model);
                int day    = Convert.ToInt32(fmrzInfo.GetModel(ids).stay_day) + Convert.ToInt32(txt_liveDay.Value);

                string sql = "update occu_infor set stay_day='" + day + "',depar_time='" + txt_xdDate.Value + "' where occ_id=" + fmrzInfo.GetModel(ids).occ_id + " ";
                fmrzInfo.Updates(sql);
                if (Result > 0 && fmrzInfo.Add(Ocmodels) > 0)
                {
                    Helper.AddRoom(model.ga_roomNumber);
                    //  Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "");
                    ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'>if(confirm('续住成功,是否打印收款单?')){XZintRZ(this," + fmrzInfo.GetModel(ids).order_id + ") }else{Close('房态图'); }; parent.Window_Close();</script>");
                }
                else
                {
                    Maticsoft.Common.MessageBox.ShowAndRedirect(this, "续住失败!", "");
                }
            }
            catch { }
        }
Esempio n. 3
0
        /// <summary>
        /// 保存
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdds_Click(object sender, EventArgs e)
        {
            CdHotelManage.Model.goods_account model = new CdHotelManage.Model.goods_account();
            CdHotelManage.BLL.goods_account   bll   = new CdHotelManage.BLL.goods_account();
            model.ga_number     = DDlName.SelectedValue;
            model.ga_name       = DDlName.SelectedItem.Text;
            model.ga_Type       = 1;
            model.ga_price      = 0;
            model.ga_sum_price  = Convert.ToDecimal(txt_Money.Value);
            model.ga_date       = Convert.ToDateTime(System.DateTime.Now);
            model.ga_people     = UserNow.UserID;
            model.ga_sfacount   = "否";
            model.ga_remker     = txt_Remaker.Value;
            model.ga_occuid     = fmrzInfo.GetModel(ids).order_id;
            model.ga_roomNumber = fmrzInfo.GetModel(ids).room_number;
            model.Ga_goodNo     = fmrzInfo.GetModel(ids).occ_no;
            int Result = bll.Add(model);

            if (Result > 0)
            {
                Helper.AddRoom(model.ga_roomNumber);
                if (DDlZffs.SelectedValue != "入账")
                {
                    model.ga_number     = DDlName.SelectedItem.Text;
                    model.ga_name       = "费用收款";
                    model.ga_unit       = "";
                    model.ga_Type       = 0;
                    model.ga_price      = Convert.ToDecimal(txt_Money.Value);
                    model.ga_sum_price  = 0;
                    model.ga_date       = Convert.ToDateTime(System.DateTime.Now);
                    model.ga_people     = UserNow.UserID;
                    model.ga_sfacount   = "否";
                    model.ga_zffs_id    = Convert.ToInt32(DDlZffs.SelectedValue);
                    model.ga_remker     = "费用收款";
                    model.ga_roomNumber = fmrzInfo.GetModel(ids).room_number;
                    model.ga_occuid     = fmrzInfo.GetModel(ids).order_id;
                    model.Ga_goodNo     = fmrzInfo.GetModel(ids).occ_no;
                    Result = bll.Add(model);
                }
                ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>ShowOk();</script>");
            }
            else
            {
                Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存失败!", "");
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 换房
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdds_Click(object sender, EventArgs e)
        {
            Model.occu_infor mode = new Model.occu_infor();
            string           SQl  = "update room_number set Rn_state=4 where Rn_roomNum='" + labfh.Text + "';update room_number set Rn_state=2 where Rn_roomNum='" + txt_RoomNum.Value + "'";;

            Model.occu_infor Ocmodels = new Model.occu_infor();
            Ocmodels.state_id        = 2;
            Ocmodels.continuelive    = ids;
            Ocmodels.occ_time        = System.DateTime.Now;
            Ocmodels.room_number     = (txt_RoomNum.Value).ToString();
            Ocmodels.real_price      = Convert.ToDecimal(txt_Money.Value);
            Ocmodels.remark          = txt_Remaker.Value;
            Ocmodels.state_id        = 0;
            Ocmodels.occ_no          = fmrzInfo.GetModel(ids).occ_no;
            Ocmodels.occ_name        = fmrzInfo.GetModel(ids).occ_name;
            Ocmodels.occ_with        = "否";
            Ocmodels.stay_day        = fmrzInfo.GetModel(ids).stay_day;
            Ocmodels.depar_time      = fmrzInfo.GetModel(ids).depar_time;
            Ocmodels.sex             = fmrzInfo.GetModel(ids).sex;
            Ocmodels.card_id         = fmrzInfo.GetModel(ids).card_id;
            Ocmodels.brithday        = fmrzInfo.GetModel(ids).brithday;
            Ocmodels.family_name     = fmrzInfo.GetModel(ids).family_name;
            Ocmodels.address         = fmrzInfo.GetModel(ids).address;
            Ocmodels.meth_pay_id     = fmrzInfo.GetModel(ids).meth_pay_id;
            Ocmodels.deposit         = fmrzInfo.GetModel(ids).deposit;
            Ocmodels.remark          = fmrzInfo.GetModel(ids).remark;
            Ocmodels.lordRoomid      = (txt_RoomNum.Value).ToString();
            Ocmodels.phonenum        = fmrzInfo.GetModel(ids).phonenum;
            Ocmodels.Room_type_model = fmrzInfo.GetModel(ids).Room_type_model;
            Ocmodels.source_id       = fmrzInfo.GetModel(ids).source_id;
            Ocmodels.real_mode_id    = fmrzInfo.GetModel(ids).real_mode_id;
            Ocmodels.real_scheme_id  = fmrzInfo.GetModel(ids).real_scheme_id;
            Ocmodels.real_type_id    = fmrzInfo.GetModel(ids).real_type_id;
            Ocmodels.order_id        = fmrzInfo.GetModel(ids).order_id;
            Ocmodels.tuifaId         = "0";
            string noces  = System.DateTime.Now.ToString().Replace("-", "").Replace(":", "").Replace(" ", "");
            string strsql = "";

            if (fmrzInfo.GetRecordCount("where order_id='" + Ocmodels.order_id + "'") == 1)
            {
                strsql = "update occu_infor set state_id=2,tuifaId=2,continuelive=1 ,order_id='" + noces + "' where occ_id='" + ids + "'";
            }
            else
            {
                //  strsql = "update occu_infor set state_id=3,tuifaId=2,continuelive=1 where order_id=" + Ocmodels.order_id + "";
                strsql = "update occu_infor set state_id=2,tuifaId=2,continuelive=1 where occ_id=" + ids + "";
            }
            fmrzInfo.Updates(strsql);
            CdHotelManage.Model.goods_account model = new CdHotelManage.Model.goods_account();
            CdHotelManage.BLL.goods_account   bll   = new CdHotelManage.BLL.goods_account();
            double money = double.Parse(txt_Money.Value) - double.Parse(labSymoney.Text);

            if (money > 0)
            {
                money = double.Parse(labSymoney.Text) - double.Parse(txt_Money.Value);
            }
            else
            {
                money = double.Parse(labSymoney.Text);
            }
            string Remaker = labname.Text + "从" + labfh.Text + "换到" + txt_RoomNum.Value + " 从" + labkffs.Text + "(" + labSymoney.Text + ")调整为天房(" + txt_Money.Value + ") 操作时间:" + System.DateTime.Now;
            string beizhu  = fmGoods.GetModels(" where ga_Type=8 order by ga_date ").ga_remker + Remaker + ",";
            string Date    = fmGoods.GetModels(" where ga_Type=8 order by ga_date ").ga_date.ToString();
            string upsql   = "update goods_account set ga_sum_price='" + money + "',ga_remker='" + beizhu + "' where ga_Type=8 and  datediff(SS,ga_date,'" + Date + "')=0 and ga_occuid='" + Ocmodels.order_id + "'";

            fmGoods.Updates(upsql);
            if (fhBll.Updates(SQl) && fmrzInfo.Add(Ocmodels) > 0)
            {
                Helper.AddRoom(Ocmodels.room_number);
                Helper.AddRoom(Ocmodels.lordRoomid);
                //Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "");
                ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'>if(confirm('换房成功,是否打换房单')){Show(" + ids + ");}else{ parent.location.reload(); };</script>");
            }
            else
            {
                Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存失败!", "");
            }
        }
        //public void Bind()
        //{
        //    Model.occu_infor mod = new Model.occu_infor();
        //    labfh.Text = fmrzInfo.GetModel(ids).room_number;
        //    labfx.Text = GetRealTypeName((fmrzInfo.GetModel(ids).real_type_id));
        //    labkffs.Text = GetKffsName(fmrzInfo.GetModel(ids).real_mode_id);
        //    lably.Text = GetLYName(fmrzInfo.GetModel(ids).source_id);
        //    labname.Text = fmrzInfo.GetModel(ids).occ_name.ToString();
        //    labrzDate.Text = fmrzInfo.GetModel(ids).occ_time.ToString();
        //    labfjMoney.Text = fmrzInfo.GetModel(ids).real_price.ToString();

        //    double ysMoney = 0;
        //    DataSet dt = fmgoodvount.GetList(" ga_occuid in ('" + fmrzInfo.GetModel(ids).order_id + "')");
        //    foreach (DataRow dr in dt.Tables[0].Rows)
        //    {
        //        try
        //        {
        //            ysMoney += double.Parse(dr["ga_sum_price"].ToString());
        //        }
        //        catch { }
        //    }
        //    labSymoney.Text = ysMoney.ToString();
        //}

        /// <summary>
        /// 确认添加
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAdds_Click(object sender, EventArgs e)
        {
            string no     = "CZ" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss").Replace("-", "").Replace(":", "").Replace(" ", "").Replace("/", "");
            int    Result = 0;

            CdHotelManage.Model.goods_account model = new CdHotelManage.Model.goods_account();
            CdHotelManage.BLL.goods_account   bll   = new CdHotelManage.BLL.goods_account();
            int b = hidcontent.Value.Split('|').Length;

            string[] hidcon = hidcontent.Value.Split('|');
            for (int i = 0; i < hidcon.Length - 1; i++)
            {
                try
                {
                    model.ga_number = hidcon[i].Split('#')[0];
                    model.ga_name   = hidcon[i].Split('#')[1];
                    model.ga_unit   = hidcon[i].Split('#')[2];
                    model.ga_Type   = 204;
                    model.ga_price  = 0;
                    model.ga_num    = Convert.ToInt32(hidcon[i].Split('#')[4]);
                    string a = hidcon[i].Split('#')[5];
                    model.ga_sum_price = Convert.ToDecimal(hidcon[i].Split('#')[5]);
                    model.ga_date      = Convert.ToDateTime(System.DateTime.Now);
                    model.ga_people    = UserNow.UserID;
                    model.ga_sfacount  = "否";
                    model.Ga_Account   = ga_Account.Text;
                    // model.ga_zffs_id = Convert.ToInt32(DDlZffs.SelectedValue);
                    model.ga_remker = txt_Remaker.Value;
                    model.Ga_goodNo = no;

                    Result = bll.Add(model);

                    //if (DDlZffs.SelectedValue != "入账")
                    //{
                    //    model.ga_number = hidcon[i].Split('#')[0];
                    //    model.ga_name = "商品收款";
                    //    model.ga_unit = hidcon[i].Split('#')[2];
                    //    model.ga_Type = 0;
                    //    model.ga_price = Convert.ToDecimal(hidcon[i].Split('#')[5]);
                    //    model.ga_num = Convert.ToInt32(hidcon[i].Split('#')[4]);
                    //    model.ga_sum_price = 0;
                    //    model.ga_date = Convert.ToDateTime(System.DateTime.Now);
                    //    model.ga_people = UserNow.UserID;
                    //    model.ga_sfacount = "否";
                    //    model.ga_zffs_id = Convert.ToInt32(DDlZffs.SelectedValue);
                    //    model.ga_remker = txt_Remaker.Value;
                    //    model.ga_roomNumber = fmrzInfo.GetModel(ids).room_number;
                    //    model.ga_occuid = fmrzInfo.GetModel(ids).order_id;
                    //    model.Ga_goodNo = fmrzInfo.GetModel(ids).occ_no;
                    //    Result = bll.Add(model);
                    //}
                }

                catch
                {
                }
            }
            if (Result > 0)
            {
                // ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript' defer>alert('保存成功');parent.document.getElementById('btnsercher').click();parent.Window_Close();</script>");
                // ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "alert('保存成功');parent.document.getElementById('btnsercher').click();parent.Window_Close();", "", true);
                //Helper.AddRoom(model.ga_roomNumber);
                ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "click", "alert('保存成功');parent.window.location.href='account_goods.aspx?readValue=204&accounts=" + ga_Account.Text + "';", true);
            }
        }