示例#1
0
        public string Ffjrb_krly_add_edit(string id, string yydh, string qymc, string fjrb_code, string fjrb, string sjjg, string krly, string add_edit_delete, string xxzs)
        {
            string s = common_file.common_app.get_failure;

            Ffjzt.Ffjrb_krly Ffjrb_krly_add_edit_new = new Hotel_app.Server.Ffjzt.Ffjrb_krly();
            s = Ffjrb_krly_add_edit_new.Ffjrb_krly_add_edit(id, yydh, qymc, fjrb_code, fjrb, sjjg, krly, add_edit_delete, xxzs);
            return(s);
        }
示例#2
0
        private void b_delete_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if (DS_Ffjrb_krly != null && DS_Ffjrb_krly.Tables[0].Rows.Count > 0)
            {
                if (common_file.common_app.message_box_show_select(common_file.common_app.message_title, "是否要删除所选中的记录!") == true)
                {
                    int j = 0; string s = "";
                    for (int i = 0; i < dg_count; i++)
                    {
                        common_file.common_app.get_czsj();
                        DataGridViewDataErrorContexts ss = new DataGridViewDataErrorContexts();
                        if (this.dg_fjrbkrly.Rows[i].Cells[0].GetEditedFormattedValue(i, ss) != null && Convert.ToBoolean(this.dg_fjrbkrly.Rows[i].Cells[0].GetEditedFormattedValue(i, ss)) == true)
                        {
                            j = Convert.ToInt32(dg_fjrbkrly.Rows[i].Index.ToString());
                            if (DS_Ffjrb_krly.Tables[0].Rows[j]["id"].ToString() != "")
                            {
                                string   url  = common_file.common_app.service_url + "Ffjzt/Ffjzt_app.asmx";
                                object[] args = new object[9];
                                args[0] = DS_Ffjrb_krly.Tables[0].Rows[j]["id"].ToString();
                                args[1] = common_file.common_app.yydh;
                                args[2] = common_file.common_app.qymc;
                                args[3] = "";
                                args[4] = "";
                                args[5] = "";
                                args[6] = "";
                                args[7] = common_file.common_app.get_delete;
                                args[8] = common_file.common_app.xxzs;

                                Hotel_app.Server.Ffjzt.Ffjrb_krly Ffjrb_krly_services = new Hotel_app.Server.Ffjzt.Ffjrb_krly();
                                string result = Ffjrb_krly_services.Ffjrb_krly_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_krly_add_edit", args);
                                if (result == common_file.common_app.get_suc && (s == common_file.common_app.get_suc || s == ""))
                                {
                                    s = common_file.common_app.get_suc;
                                }
                                else
                                {
                                    s = common_file.common_app.get_failure;
                                }
                            }
                            //common_file.common_app.Message_box_show(common_file.common_app.message_title, dataGridViewSummary1.Rows[i].Index.ToString());
                        }
                    }
                    if (s == common_file.common_app.get_suc)
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "删除成功!");
                    }
                    else
                    if (s == common_file.common_app.get_failure)
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "删除不成功!");
                    }
                    refresh_app();
                }
            }
            Cursor.Current = Cursors.Default;
        }
示例#3
0
        public void save_new()
        {
            string strfjrb = this.tB_fjrb.Text;
            string strkrly = this.tB_krly.Text;

            //添加里判断有没有相同协议单位的房间类型相同的数据存在
            if (judge_add_edit == common_file.common_app.get_add)
            {
                if (B_Ffjrb_krly.GetModelList("fjrb='" + strfjrb + "' and krly='" + strkrly + "' ").Count > 0)
                {
                    common_file.common_app.Message_box_show(common_file.common_app.message_title, "已经存在相同数据了");
                    return;
                }
            }

            //修改里同样也要判断有没有相同的数据存在
            if (judge_add_edit == common_file.common_app.get_edit)
            {
                if (B_Ffjrb_krly.GetModelList("fjrb='" + strfjrb + "' and krly='" + strkrly + "' and id<>" + Hhyfj_id + "").Count > 0)
                {
                    common_file.common_app.Message_box_show(common_file.common_app.message_title, "已经存在相同数据了");
                    return;
                }
            }



            string url = common_file.common_app.service_url + "Ffjzt/Ffjzt_app.asmx";

            object[] args = new object[9];
            args[0] = Hhyfj_id;
            args[1] = common_file.common_app.yydh;
            args[2] = common_file.common_app.qymc;
            args[3] = fjrb_code;
            args[4] = tB_fjrb.Text.Trim().Replace("'", "-");
            args[5] = tB_hyfj.Text.Trim().Replace("'", "-");
            args[6] = tB_krly.Text.Trim().Replace("'", "-");
            args[7] = judge_add_edit;
            args[8] = common_file.common_app.xxzs;

            Hotel_app.Server.Ffjzt.Ffjrb_krly Ffjrb_krly_services = new Hotel_app.Server.Ffjzt.Ffjrb_krly();
            string result = Ffjrb_krly_services.Ffjrb_krly_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_krly_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)
                {
                    common_file.common_app.get_czsj();
                    parent_form.refresh_app();


                    tB_hyfj.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, "操作失败!");
            }
        }