//保存主单 private void SaveNew_xfmx() { string url = common_file.common_app.service_url + "Xxtsz/Xxtsz_app.asmx"; object[] args = new object[21]; args[0] = Xxfxr_id; args[1] = common_file.common_app.yydh; args[2] = common_file.common_app.qymc; args[3] = GetDrbh(tB_xfdr.Text); //xfgg,jjje,xftm,xfcd,xfdw,jldw, args[4] = tB_xfdr.Text.Trim().Replace("'", "_"); args[5] = Getxrbh(tB_xfxr.Text); args[6] = tB_xfxr.Text.Trim().Replace("'", "_"); args[7] = tB_mxbh.Text.Trim().Replace("'", "_"); args[8] = tB_xfmx.Text.Trim().Replace("'", "_"); args[9] = tB_xfje.Text.Trim().Replace("'", "_"); args[10] = tB_zjm.Text.Trim().Replace("'", "_"); args[11] = tB_xfgg.Text.Trim().Replace("'", "_"); args[12] = tB_jjje.Text.Trim().Replace("'", "_"); args[13] = tB_xftm.Text.Trim().Replace("'", "_"); args[14] = tB_xfcd.Text.Trim().Replace("'", "_"); args[15] = tB_xfdw.Text.Trim().Replace("'", "_"); args[16] = tB_xfjl.Text.Trim().Replace("'", "_"); args[17] = Cb_is_tj_kc.Checked; args[18] = tB_kcsl.Text.Trim().Replace("'", "_"); args[19] = judge_add_edit; args[20] = common_file.common_app.xxzs; Hotel_app.Server.Xxtsz.Xxfmx Xxfmx_services = new Hotel_app.Server.Xxtsz.Xxfmx(); string result = Xxfmx_services.Xxfmx_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(), args[9].ToString(), args[10].ToString(), args[11].ToString(), args[12].ToString(), args[13].ToString(), args[14].ToString(), args[15].ToString(), args[16].ToString(), bool.Parse(args[17].ToString()), args[18].ToString(), args[19].ToString(), args[20].ToString()); //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Xxfmx_add_edit", args); if (result != null && 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_xfxr.Text = ""; //tB_xfdr.Text = ""; tB_mxbh.Focus(); tB_mxbh.Text = ""; tB_xfmx.Text = ""; tB_zjm.Text = ""; tB_xfje.Text = ""; tB_xfgg.Text = ""; tB_xftm.Text = ""; tB_xfcd.Text = ""; tB_xfdw.Text = ""; tB_xfjl.Text = ""; tB_jjje.Text = ""; } else if (judge_add_edit == common_file.common_app.get_edit) { parent_form.InitializeApp(); this.Close(); } } else { common_file.common_app.Message_box_show(common_file.common_app.message_title, "操作失败!"); } }
private void b_delete_Click(object sender, EventArgs e) { common_file.common_app.get_czsj(); if (common_file.common_roles.get_user_qx("B_xfxm__sc", common_file.common_app.user_type) == false) { return; } if (DS_Xxfmx != null && DS_Xxfmx.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_xfmx.Rows[i].Cells[0].GetEditedFormattedValue(i, ss) != null && Convert.ToBoolean(this.dg_xfmx.Rows[i].Cells[0].GetEditedFormattedValue(i, ss)) == true) { //j = Convert.ToInt32(dg_xfmx.Rows[i].Index.ToString()); DataRowView dgr = dg_xfmx.Rows[i].DataBoundItem as DataRowView; j = DS_Xxfmx.Tables[0].Rows.IndexOf(dgr.Row); if (DS_Xxfmx.Tables[0].Rows[j]["id"].ToString() != "") { string url = common_file.common_app.service_url + "Xxtsz/Xxtsz_app.asmx"; object[] args = new object[21]; args[0] = DS_Xxfmx.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] = ""; args[8] = ""; args[9] = ""; args[10] = ""; args[11] = ""; args[12] = ""; args[13] = ""; args[14] = ""; args[15] = ""; args[16] = ""; args[17] = true; args[18] = "0"; args[19] = common_file.common_app.get_delete; args[20] = common_file.common_app.xxzs; Hotel_app.Server.Xxtsz.Xxfmx Xxfmx_services = new Hotel_app.Server.Xxtsz.Xxfmx(); string result = Xxfmx_services.Xxfmx_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(), args[9].ToString(), args[10].ToString(), args[11].ToString(), args[12].ToString(), args[13].ToString(), args[14].ToString(), args[15].ToString(), args[16].ToString(), bool.Parse(args[17].ToString()), args[18].ToString(), args[19].ToString(), args[20].ToString()); //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Xxfmx_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; } } } } 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; }