Beispiel #1
0
        private void b_save_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if (tB_jdlh.Text.Trim() == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,楼号不能为空!");
                tB_jdlh.Focus();
            }
            else
            if (tB_jdlh_name.Text.Trim() == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,楼名不能为空!");
                tB_jdlh_name.Focus();
            }
            else
            if (tB_jdcs.Text.Trim() == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,层数不能为空!");
                tB_jdcs.Focus();
            }
            else
            if (tB_jdcs_name.Text.Trim() == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,层数不能为空!");
                tB_jdcs_name.Focus();
            }
            else
            if (tB_fjrb.Text.Trim() == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,房态不能为空!");
                tB_fjrb.Focus();
            }
            else
            if (tB_fjbh.Text.Trim() == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,房号不能为空!");
                tB_fjbh.Focus();
            }
            else
            {
                int judge_save = 3;

                if (judge_add_edit == common_file.common_app.get_add)        //新增
                {
                    BLL.Common B_Common = new Hotel_app.BLL.Common();
                    DataSet    DS_temp  = B_Common.GetList("select id from Ffjzt", "fjbh='" + tB_fjbh.Text + "'" + common_file.common_app.yydh_select);
                    if (DS_temp != null && DS_temp.Tables[0].Rows.Count > 0)
                    {
                        judge_save = 4;
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,您设置的房号已经存在了");
                    }
                    DS_temp.Dispose();
                }


                if (judge_save == 3)
                {
                    string   url  = common_file.common_app.service_url + "Ffjzt/Ffjzt_app.asmx";
                    string[] args = new string[15];
                    args[0]  = Ffjzt_id;
                    args[1]  = common_file.common_app.yydh;
                    args[2]  = common_file.common_app.qymc;
                    args[3]  = tB_jdlh.Text.Trim().Replace("'", "//");
                    args[4]  = tB_jdlh_name.Text.Trim().Replace("'", "//");
                    args[5]  = tB_jdcs.Text.Trim().Replace("'", "//");
                    args[6]  = tB_jdcs_name.Text.Trim().Replace("'", "//");
                    args[7]  = tB_fjrb.Text.Trim().Replace("'", "//");
                    args[8]  = get_fjrb_code;
                    args[9]  = tB_fjbh.Text.Trim().Replace("'", "//");
                    args[10] = tB_fjdh.Text.Trim().Replace("'", "//");
                    args[11] = tB_dhfj.Text.Trim().Replace("'", "//");
                    args[12] = tB_bz.Text.Trim().Replace("'", "//");
                    args[13] = judge_add_edit;
                    args[14] = common_file.common_app.xxzs;

                    Hotel_app.Server.Ffjzt.Ffjzt_app Ffjzt_app_services = new Hotel_app.Server.Ffjzt.Ffjzt_app();
                    string result = Ffjzt_app_services.Ffjzt_add_edit_delete(args[0].ToString(), args[1].ToString(), args[2].ToString(), args[3].ToString(), args[4].ToString(), args[5].ToString(), args[6].ToString(), args[7].ToString(), args[8].ToString(), args[9].ToString(), args[10].ToString(), args[11].ToString(), args[12].ToString(), args[13].ToString(), args[14].ToString());
                    //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Ffjzt_add_edit_delete", args);
                    if (result == common_file.common_app.get_suc)
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "保存成功!");
                        if (judge_add_edit == common_file.common_app.get_add)
                        {
                            parent_form.refresh_app();
                            tB_fjbh.Focus(); tB_fjbh.Text = ""; tB_fjdh.Text = ""; tB_dhfj.Text = ""; tB_bz.Text = "";
                        }
                        else if (judge_add_edit == common_file.common_app.get_edit)
                        {
                            parent_form.refresh_app();
                            this.Close();
                        }
                    }
                    else
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "操作失败!");
                    }
                }

                //tB_bz.Text = judge_add_edit;
            }

            Cursor.Current = Cursors.Default;
        }
Beispiel #2
0
        private void b_save_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if (tB_fjrb_code.Text.Trim() == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,代码不能为空!");
                tB_fjrb_code.Focus();
            }
            else
            if (tB_fjrb.Text.Trim() == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,房型不能为空!");
                tB_fjrb.Focus();
            }
            else
            if (tB_sjjg.Text.Trim() == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,房价不能为空!");
                tB_sjjg.Focus();
            }
            else
            if (Maticsoft.Common.PageValidate.IsNumber(tB_sjjg.Text.Trim()) == false && Maticsoft.Common.PageValidate.IsDecimal(tB_sjjg.Text.Trim()) == false)
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,所输入的房价不是有效数字!");
                tB_sjjg.Focus();
            }
            else
            if (tB_zyrs.Text.Trim() == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,预占人数不能为空!");
                tB_zyrs.Focus();
            }
            else
            if (Maticsoft.Common.PageValidate.IsNumber(tB_zyrs.Text.Trim()) == false && Maticsoft.Common.PageValidate.IsDecimal(tB_zyrs.Text.Trim()) == false)
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,预占人数不是有效数字!");
                tB_zyrs.Focus();
            }
            else
            {
                int judge_save = 3;        //3保存,其余不保存

                judge_save = common_file.common_app.get_judge_repeat("Ffjrb", "fjrb_code", "对不起,代码原来就存在了!", tB_fjrb_code.Text, judge_add_edit, Ffjrb_id);


                if (judge_save == 3)
                {
                    judge_save = common_file.common_app.get_judge_repeat("Ffjrb", "fjrb", "对不起,房型原来就存在了!", tB_fjrb.Text, judge_add_edit, Ffjrb_id);
                }
                if (judge_save == 3)
                {
                    string   url  = common_file.common_app.service_url + "Ffjzt/Ffjzt_app.asmx";
                    string[] args = new string[9];
                    args[0] = Ffjrb_id;
                    args[1] = common_file.common_app.yydh;
                    args[2] = common_file.common_app.qymc;
                    args[3] = tB_fjrb_code.Text.Trim().Replace("'", "//");
                    args[4] = tB_fjrb.Text.Trim().Replace("'", "//");
                    args[5] = tB_sjjg.Text.Trim().Replace("'", "//");
                    args[6] = tB_zyrs.Text.Trim().Replace("'", "//");
                    args[7] = judge_add_edit;
                    args[8] = common_file.common_app.xxzs;

                    Hotel_app.Server.Ffjzt.Ffjzt_app Ffjzt_app_services = new Hotel_app.Server.Ffjzt.Ffjzt_app();
                    string result = Ffjzt_app_services.Ffjrb_add_edit(args[0].ToString(), args[1].ToString(), args[2].ToString(), args[3].ToString(), args[4].ToString(), args[5].ToString(), args[6].ToString(), args[7].ToString(),
                                                                      args[8].ToString());

                    //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Ffjrb_add_edit", args);
                    if (result == common_file.common_app.get_suc)
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "保存成功!");
                        if (judge_add_edit == common_file.common_app.get_add)
                        {
                            parent_form.refresh_app(); tB_fjrb_code.Text = ""; tB_fjrb_code.Focus(); tB_fjrb.Text = ""; tB_sjjg.Text = "0"; tB_zyrs.Text = "1";
                        }
                        else if (judge_add_edit == common_file.common_app.get_edit)
                        {
                            parent_form.refresh_app(); this.Close();
                        }
                    }
                    else
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "操作失败!");
                    }
                }
            }

            Cursor.Current = Cursors.Default;
        }