Пример #1
0
        private void b_delete_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if (xygz == common_file.common_xydw.krly_xydw)
            {
                if (common_file.common_roles.get_user_qx("B_xydwgl_sc", common_file.common_app.user_type) == false)
                {
                    return;
                }
            }
            if (xygz == common_file.common_xydw.xyrx_gzdw)
            {
                if (common_file.common_roles.get_user_qx("B_gzdwgl_sc", common_file.common_app.user_type) == false)
                {
                    return;
                }
            }
            if (DS_Yxydw != null && DS_Yxydw.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_xydw.Rows[i].Cells[0].GetEditedFormattedValue(i, ss) != null && Convert.ToBoolean(this.dg_xydw.Rows[i].Cells[0].GetEditedFormattedValue(i, ss)) == true)
                        {
                            //j = Convert.ToInt32(dg_xydw.Rows[i].Index.ToString());

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


                            if (DS_Yxydw.Tables[0].Rows[j]["id"].ToString() != "")
                            {
                                byte[]   imageb = new byte[0];
                                string   url    = common_file.common_app.service_url + "Yyxzx/Yyxzx_app.asmx";
                                object[] args   = new object[21];
                                args[0]  = DS_Yxydw.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] = imageb;
                                args[16] = "";
                                args[17] = "";
                                args[18] = common_file.common_app.get_delete;
                                args[19] = common_file.common_app.xxzs;
                                args[20] = "0";

                                Hotel_app.Server.Yyxzx.Yxydw Yxydw_services = new Hotel_app.Server.Yyxzx.Yxydw();
                                string result = Yxydw_services.Yxydw_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(), imageb, args[16].ToString(), args[17].ToString(), args[18].ToString(), args[19].ToString(), args[20].ToString());
                                //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Yxydw_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;
        }
Пример #2
0
        //保存主单
        private void SaveNew_xydw()
        {
            int judge_save = 3;//3保存,其余不保存

            judge_save = common_file.common_app.get_judge_repeat("Yxydw", "xydw", "协议单位已经存在", tB_xydw.Text, judge_add_edit, Yxydw_id);
            if (judge_save == 3)
            {
                mode_xydw = bll_xydw.GetModel(strid);
                byte[] imageb = new byte[0];
                if (savePath != "" && savePath != null)
                {
                    FileStream fs = File.OpenRead(savePath);
                    imageb = new byte[fs.Length];
                    fs.Read(imageb, 0, imageb.Length);
                }
                else if (strid >= 0)
                {
                    if (mode_xydw != null && mode_xydw.sign_image != null)
                    {
                        imageb = mode_xydw.sign_image;
                    }
                }
                if (judge_add_edit == common_file.common_app.get_add)
                {
                    strxyh = common_file.common_ddbh.ddbh("xydw", "xydwdate", "xydwcounter", 6);
                }
                //else
                //{
                //    //if (common_file.common_xydw.Isyydh(mode_xydw.yydh))
                //    //{
                //    //    strxyh = mode_xydw.xyh;


                //    //}
                //    //else
                //    //{

                //    //    common_file.common_app.Message_box_show(common_file.common_app.message_title, "不是本店的协议单位不能修改,请联系管理人员!");
                //    //    return;

                //    //}

                //}


                string stryydh = common_file.common_app.yydh;
                string strqymc = common_file.common_app.qymc;

                string   url  = common_file.common_app.service_url + "Yyxzx/Yyxzx_app.asmx";
                object[] args = new object[21];
                args[0]  = Yxydw_id;
                args[1]  = stryydh;
                args[2]  = strqymc;
                args[3]  = tB_zjm.Text.Trim().Replace("'", "-");
                args[4]  = cB_xyrx.Text.Trim().Replace("'", "-");
                args[5]  = tB_xyh_inner.Text.Trim().Replace("'", "-");
                args[6]  = tB_xydw.Text.Trim().Replace("'", "-");
                args[7]  = tB_nxr.Text.Trim().Replace("'", "-");
                args[8]  = tB_krdh.Text.Trim().Replace("'", "-");
                args[9]  = tB_Email.Text.Trim().Replace("'", "-");
                args[10] = tB_krcz.Text.Trim().Replace("'", "-");
                args[11] = tB_qydz.Text.Trim().Replace("'", "-");
                args[12] = tB_xsy.Text.Trim().Replace("'", "-");
                args[13] = tB_bz.Text.Trim().Replace("'", "-");
                args[14] = cB_krly.Text.Trim().Replace("'", "-");
                args[15] = imageb;
                args[16] = xygz;//单位类型
                args[17] = strxyh;
                args[18] = judge_add_edit;
                args[19] = common_file.common_app.xxzs;
                args[20] = tb_sxed.Text.Trim().Replace("'", "-");

                Hotel_app.Server.Yyxzx.Yxydw Yxydw_services = new Hotel_app.Server.Yyxzx.Yxydw();
                string result = Yxydw_services.Yxydw_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(), imageb, args[16].ToString(), args[17].ToString(), args[18].ToString(), args[19].ToString(), args[20].ToString());
                //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Yxydw_add_edit", args);
                if (result != null && 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)
                    {
                        common_file.common_czjl.add_czjl(stryydh, strqymc, common_file.common_app.czy, "添加协议单位", "" + strxyh + "", "", DateTime.Now);
                        common_file.common_form.Yxydw_browse_new.InitializeApp(xygz);
                        tB_xydw.Text = "";
                        tB_xydw.Focus();
                        tB_zjm.Text       = "";
                        tB_Email.Text     = "";
                        tB_krcz.Text      = "";
                        tB_krdh.Text      = "";
                        tB_nxr.Text       = "";
                        tB_qydz.Text      = "";
                        tB_xsy.Text       = "";
                        tB_xyh_inner.Text = "";
                        tb_sxed.Text      = "0";
                    }
                    else if (judge_add_edit == common_file.common_app.get_edit)
                    {
                        common_file.common_czjl.add_czjl(stryydh, strqymc, common_file.common_app.czy, "修改协议单位", "" + strxyh + "", "", DateTime.Now);
                        //common_file.common_form.Yxydw_browse_new.InitializeApp(xygz);
                        common_file.common_form.Yxydw_browse_new.refresh_app();
                        this.Close();
                    }
                }
                else
                {
                    common_file.common_app.Message_box_show(common_file.common_app.message_title, "操作失败!");
                }
            }
        }