Exemple #1
0
        void Save_new()
        {
            //id,yydh,qymc,jbxs,hyrx,dfjf,is_top,is_select
            int judge_save = 3;//3保存,其余不保存

            if (judge_save == 3)
            {
                //id,yydh,qymc,krly,hyrx,jfbl,hyjfrx,is_top,is_select
                string   url  = common_file.common_app.service_url + "Hhygl/Hhygl_app.asmx";
                object[] args = new object[9];
                args[0] = Hhyjfbl_id;
                args[1] = common_file.common_app.yydh;
                args[2] = common_file.common_app.qymc;
                args[3] = cB_krly.Text.Trim().Replace("'", "-");
                args[4] = cB_hyrx.Text.Trim().Replace("'", "-");
                args[5] = tB_jfbl.Text.Trim().Replace("'", "-");
                args[6] = common_file.common_app.hyjfrx;
                args[7] = judge_add_edit;
                args[8] = common_file.common_app.xxzs;
                Hotel_app.Server.Hhygl.Hhyjf_bl Hhyjf_bl_services = new Hotel_app.Server.Hhygl.Hhyjf_bl();
                string result = Hhyjf_bl_services.Hhyjfbl_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, "Hhyjfbl_add_edit", args);
                if (result.ToString() == 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_jfbl.Text = ""; tB_jfbl.Focus();
                    }
                    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, "操作失败!");
                }
            }
        }
Exemple #2
0
        private void b_delete_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if (DS_Hhyjfbl != null && DS_Hhyjfbl.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_hyjfbl.Rows[i].Cells[0].GetEditedFormattedValue(i, ss) != null && Convert.ToBoolean(this.dg_hyjfbl.Rows[i].Cells[0].GetEditedFormattedValue(i, ss)) == true)
                        {
                            //j = Convert.ToInt32(dg_hyjfbl.Rows[i].Index.ToString());

                            DataRowView dgr = dg_hyjfbl.Rows[i].DataBoundItem as DataRowView;
                            j = DS_Hhyjfbl.Tables[0].Rows.IndexOf(dgr.Row);

                            if (DS_Hhyjfbl.Tables[0].Rows[j]["id"].ToString() != "")
                            {
                                string   url  = common_file.common_app.service_url + "Hhygl/Hhygl_app.asmx";
                                string[] args = new string[9];
                                args[0] = DS_Hhyjfbl.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.Hhygl.Hhyjf_bl Hhyjf_bl_services = new Hotel_app.Server.Hhygl.Hhyjf_bl();
                                string result = Hhyjf_bl_services.Hhyjfbl_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, "Hhyjfbl_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;
                                }
                            }
                        }
                        else
                        {
                            //提示
                            common_file.common_app.Message_box_show(common_file.common_app.message_title, "你好,你没有选择任何信息");
                        }
                    }
                    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;
        }