コード例 #1
0
 private void b_delete_Click(object sender, EventArgs e)
 {
     common_file.common_app.get_czsj();
     if (dg_xfmx_lkmx.CurrentRow != null)
     {
         int         i   = dg_xfmx_lkmx.CurrentRow.Index;
         DataRowView dgr = dg_xfmx_lkmx.CurrentRow.DataBoundItem as DataRowView;
         i = DS_Xxfmx.Tables[0].Rows.IndexOf(dgr.Row);
         if (DS_Xxfmx.Tables[0].Rows[i]["id"].ToString() != "")
         {
             string   url  = common_file.common_app.service_url + "Xxtsz/Xxtsz_app.asmx";
             object[] args = new object[19];
             args[0]  = DS_Xxfmx.Tables[0].Rows[i]["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] = DS_Xxfmx.Tables[0].Rows[i]["mxbh"].ToString();
             args[14] = DS_Xxfmx.Tables[0].Rows[i]["xfsl"].ToString();;
             args[15] = "";
             args[16] = common_file.common_app.get_delete;
             args[17] = common_file.common_app.xxzs;
             args[18] = "0";
             Hotel_app.Server.Xxtsz.Xxfmx_lkmx Xxfmx_lkmx_services = new Hotel_app.Server.Xxtsz.Xxfmx_lkmx();
             string result = Xxfmx_lkmx_services.Xxfmx_lkmx_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(), args[17].ToString(), args[18].ToString());
             //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Xxfmx_lkmx_add_edit", args);
             if (result == common_file.common_app.get_suc)
             {
                 common_file.common_app.Message_box_show(common_file.common_app.message_title, "删除成功!");
             }
             else
             {
                 common_file.common_app.Message_box_show(common_file.common_app.message_title, "删除不成功!");
             }
         }
         InitializeApp();
     }
     Cursor.Current = Cursors.Default;
 }
コード例 #2
0
        //保存主单
        private void SaveNew_xfmx()
        {
            //id, yydh, qymc, lsbh, lksj, czsj, czy, bz,
            //drbh, xfdr, xrbh,xfxr,xfmx, mxbh, xfsl, add_edit_delete, xxzs
            string  xfsl    = tB_xfsl.Text.Trim().Replace("'", "_");
            decimal strkcsl = Convert.ToDecimal(Get_Xxfmx_kcsl(mxbh));
            decimal strxfsl = Convert.ToDecimal(xfsl);

            //if (strkcsl > 0)
            //{
            //if (strxfsl > strkcsl && strxfsl>0)
            //{
            //    common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,入库数量不能大于库存数量,请修改数量!");


            //}
            //else
            //{
            if (is_value(lsbh, mxbh, out Xxfxr_id))
            {
                judge_add_edit = common_file.common_app.get_edit;
            }


            string url = common_file.common_app.service_url + "Xxtsz/Xxtsz_app.asmx";

            object[] args = new object[19];
            args[0]  = Xxfxr_id;
            args[1]  = common_file.common_app.yydh;
            args[2]  = common_file.common_app.qymc;
            args[3]  = lsbh;
            args[4]  = DateTime.Now.ToString();
            args[5]  = DateTime.Now.ToString();
            args[6]  = common_file.common_app.czy;
            args[7]  = tB_bz.Text.Trim().Replace("'", "_");
            args[8]  = drbh;
            args[9]  = xfdr;
            args[10] = xrbh;
            args[11] = tB_xfrb.Text.Trim().Replace("'", "_");
            args[12] = tB_xfxm.Text.Trim().Replace("'", "_");
            args[13] = mxbh;
            args[14] = xfsl;
            args[15] = tB_xftm.Text.Trim().Replace("'", "_");
            args[16] = judge_add_edit;
            args[17] = common_file.common_app.xxzs;
            args[18] = tB_lkdj.Text.Trim();

            Hotel_app.Server.Xxtsz.Xxfmx_lkmx Xxfmx_lkmx_services = new Hotel_app.Server.Xxtsz.Xxfmx_lkmx();
            string result = Xxfmx_lkmx_services.Xxfmx_lkmx_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(), args[17].ToString(), args[18].ToString());

            //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Xxfmx_lkmx_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_lk.AddXxfmx_lkmx(xrbh, xfsl);
                    parent_form.InitializeApp();
                    tB_bz.Text   = "";
                    tB_xfxm.Text = "";
                    tB_mxbh.Text = "";
                    tB_xfsl.Text = "";
                    tB_xftm.Text = "";
                    tB_zjm.Text  = "";
                    tB_xfrb.Text = "";
                    tB_lkdj.Text = "";
                    tB_xftm.Focus();
                }
                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, "操作失败!");
            }
            //}
            //}
            //else
            //{
            //    common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,库存数量为0!");

            //}
        }