Example #1
0
        private void b_save_Click(object sender, EventArgs e)
        {
            common_file.common_app.get_czsj();
            if (tB_classname.Text == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,项目类型不能为空");
                tB_classname.Focus();
            }
            else if (tB_title.Text == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,项目名称不能为空");
                tB_title.Focus();
            }
            else if (tB_dfsl.Text == "")
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,兑换数量不能为空");
                tB_dfsl.Focus();
            }
            else if ((Maticsoft.Common.PageValidate.IsDecimal(tB_dfsl.Text.Trim()) || Maticsoft.Common.PageValidate.IsNumber(tB_dfsl.Text.Trim())) == false)
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,所输入的数量不是有效数值!");
                tB_dfsl.Focus();
            }
            else
            {
                M_Hhygl = B_Hhygl.GetModelList(" id>=0  " + common_file.common_app.yydh_select + "  and   hykh='" + hykh + "'")[0];
                decimal strdfjf = Convert.ToDecimal(tB_dfjf.Text.Trim());

                if (M_Hhygl.hyjf < strdfjf)
                {
                    common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,您的积分不够。");
                    tB_classname.Focus();
                }
                else
                {
                    if (save_new() == common_file.common_app.get_suc)
                    {
                        decimal strhyzjf = M_Hhygl.hyjf - strdfjf;//会员兑换完后的积分
                        string  strSql   = " update Hhygl set hyjf=" + strhyzjf + ",shxg=1,xgsj=getdate() where hykh='" + hykh + "'";
                        int     isok     = DbHelperSQL.ExecuteSql(strSql);
                        if (isok > 0)
                        {
                            common_file.common_app.Message_box_show(common_file.common_app.message_title, "恭喜您," + tB_title.Text + "兑换成功。");

                            common_file.common_hy.Hhygl_browse_new.refresh_app();
                            common_file.common_hy.Hhygl_browse_new.open_record();
                            tB_title.Text     = "";
                            tB_dfsl.Text      = "1.0";
                            tB_dfjf.Text      = "";
                            tB_classname.Text = "";
                        }
                    }
                    else
                    {
                        common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,兑换失败。");
                    }
                }
            }
            Cursor.Current = Cursors.Default;
        }
Example #2
0
 private void b_AddCard_Click(object sender, EventArgs e)
 {
     if (common_file.common_roles.get_user_qx("B_hygl__zjzk", common_file.common_app.user_type) == false)
     {
         return;
     }
     if (Hhygl_id != "" && Hhygl_id != null)
     {
         clear_main_infor();//清空数据
         M_Hhygl = B_Hhygl.GetModel(int.Parse(Hhygl_id));
         if (M_Hhygl.parent_hykh != "" && M_Hhygl.parent_hykh != null)
         {
             p_hykh = M_Hhygl.parent_hykh;
         }
         else
         {
             p_hykh = M_Hhygl.hykh_bz;//读取主卡号
         }
         this.tB_parent_hykh.Text = p_hykh;
         add_edit           = common_file.common_app.get_add;
         this.cB_hyrx.Text  = common_file.common_hy.hyrx_yk;//银卡
         tB_hykh_bz.Enabled = true;
         FormText();
     }
     else
     {
         common_file.common_app.Message_box_show(common_file.common_app.message_title, "请选择主卡。");
         common_file.common_hy.Form_hygl_browse_new();
     }
 }
Example #3
0
 /// <param name="Qskyd_id_0">主单ID</param>
 /// <param name="yddj_flage">预订查询||登记查询</param>
 /// <param name="add_edit_flage">历史||修改</param>
 public void Hhygl_1(string Hhygl_id_0, string add_edit_flage)
 {
     Hhygl_id = Hhygl_id_0;
     //同时修改窗体的状态值
     add_edit          = add_edit_flage; //修改
     b_AddCard.Visible = true;           //增加主卡按钮
     if (add_edit == common_file.common_app.get_edit)
     {
         M_Hhygl = B_Hhygl.GetModel(int.Parse(Hhygl_id));
         hykh    = M_Hhygl.hykh;
         //如果主卡不为空,哪么就隐藏主卡按钮
         if (M_Hhygl.parent_hykh != null && M_Hhygl.parent_hykh != "")
         {
             b_AddCard.Visible = false;
         }
         else
         {
             b_AddCard.Visible = true;
         }
         BindHyjf_df();      //邦定积分兑换记录
         //BindHylsrz();     //会员入住记录
         BindHYxfjl();       //积分记录
         load_input_infor(); //修改时加载相关信息
         p_hykh = M_Hhygl.parent_hykh == null ? "" : M_Hhygl.parent_hykh;
         tB_hykh_bz.ReadOnly = true;
         cB_hyrx.Enabled     = false;
     }
     else
     {
         this.cB_hyrx.Text   = common_file.common_hy.hyrx_yk;//银卡
         tB_hykh_bz.Enabled  = true;
         tB_hykh_bz.ReadOnly = false;
     }
     FormText();
 }
Example #4
0
        //根据hykh_bz读取hykh
        public static string GetHygl(string hykh_bz)
        {
            string get_value = "";

            BLL.Hhygl   B_Hhygl = new BLL.Hhygl();
            Model.Hhygl M_Hhygl = new Model.Hhygl();
            DataSet     ds      = B_Hhygl.GetList("hykh_bz='" + hykh_bz + "'");

            if (ds.Tables[0].Rows.Count > 0)
            {
                get_value = ds.Tables[0].Rows[0]["parent_hykh"].ToString();
            }

            return(get_value);
        }
Example #5
0
        public string Hhygl_add_edit_delete_app(string id, string yydh, string qymc, string hykh, string hyrx, string hykh_bz, string krxm, string krgj, string krmz, string yxzj, string zjhm, string krsr, string krxb, string krdh, string krsj, string krEmail, string krdz, string krzy, string krdw, string qzrx, string qzhm, string zjyxq, string tlyxq, string tjrq, string lzka, string bz, string hyjf, string shxg, string xgsj, string parent_hykh, string hymm, string xsy, string czy, string add_edit_delete, string xxzs)
        {
            string s = common_file.common_app.get_failure;

            BLL.Hhygl   B_Hhygl = new BLL.Hhygl();
            Model.Hhygl M_Hhygl = new Model.Hhygl();
            if (add_edit_delete == common_file.common_app.get_add)
            {
                M_Hhygl.yydh        = yydh;
                M_Hhygl.zjhm        = zjhm;
                M_Hhygl.zjyxq       = Convert.ToDateTime(zjyxq);
                M_Hhygl.bz          = bz;
                M_Hhygl.hyjf        = Convert.ToDecimal(hyjf);
                M_Hhygl.hykh        = hykh;
                M_Hhygl.hyrx        = hyrx;
                M_Hhygl.krdh        = krdh;
                M_Hhygl.krdw        = krdw;
                M_Hhygl.krdz        = krdz;
                M_Hhygl.krEmail     = krEmail;
                M_Hhygl.krgj        = krgj;
                M_Hhygl.krmz        = krmz;
                M_Hhygl.krsj        = krsj;
                M_Hhygl.krsr        = Convert.ToDateTime(krsr);
                M_Hhygl.krxb        = krxb;
                M_Hhygl.krxm        = krxm;
                M_Hhygl.krzy        = krzy;
                M_Hhygl.hykh_bz     = hykh_bz;
                M_Hhygl.lzka        = lzka;
                M_Hhygl.qymc        = qymc;
                M_Hhygl.qzhm        = qzhm;
                M_Hhygl.qzrx        = qzrx;
                M_Hhygl.shxg        = Convert.ToBoolean(shxg);
                M_Hhygl.tjrq        = Convert.ToDateTime(tjrq);
                M_Hhygl.tlyxq       = Convert.ToDateTime(tlyxq);
                M_Hhygl.xgsj        = Convert.ToDateTime(xgsj);
                M_Hhygl.yxzj        = yxzj;
                M_Hhygl.parent_hykh = parent_hykh;
                M_Hhygl.hymm        = hymm;
                M_Hhygl.shqr        = true;
                M_Hhygl.xsy         = xsy;
                M_Hhygl.czy         = czy;
                M_Hhygl.djsj        = DateTime.Now;
                M_Hhygl.scsj        = DateTime.Parse(common_file.common_app.cssj);
                if (hhygl_shqr.hygl_shqr_add(yydh))
                {
                    M_Hhygl.shqr = false;
                }
                else
                {
                    M_Hhygl.shqr = true;
                }

                if (B_Hhygl.Add(M_Hhygl) > 0)
                {
                    s = common_file.common_app.get_suc;
                    if (hhygl_shqr.hygl_shqr_add(yydh))
                    {
                        string           dx_bz = "";
                        Hhygl_verifyCode Hhygl_verifyCode_new = new Hhygl_verifyCode();
                        if (Hhygl_verifyCode_new.Hhygl_SendMsm(hykh_bz, "", yydh, qymc, common_file.common_hyAction.hy_Action_HyNew, "", "", "", "", hykh_bz, "", xxzs).Equals(common_file.common_app.get_suc))
                        {
                            dx_bz = "发送成功";
                        }
                        else
                        {
                            dx_bz = "发送失败";
                        }
                        common_file.common_czjl.add_czjl(yydh, qymc, czy, "新增会员", "短信提醒", dx_bz, DateTime.Parse(xgsj.ToString()));
                    }
                }
            }
            else
            if (add_edit_delete == common_file.common_app.get_edit)
            {
                M_Hhygl             = B_Hhygl.GetModel(Convert.ToInt32(id));
                M_Hhygl.id          = Convert.ToInt32(id);
                M_Hhygl.yydh        = yydh;
                M_Hhygl.zjhm        = zjhm;
                M_Hhygl.zjyxq       = Convert.ToDateTime(zjyxq);
                M_Hhygl.bz          = bz;
                M_Hhygl.hyjf        = Convert.ToDecimal(hyjf);
                M_Hhygl.hykh        = hykh;
                M_Hhygl.hyrx        = hyrx;
                M_Hhygl.krdh        = krdh;
                M_Hhygl.krdw        = krdw;
                M_Hhygl.krdz        = krdz;
                M_Hhygl.krEmail     = krEmail;
                M_Hhygl.krgj        = krgj;
                M_Hhygl.krmz        = krmz;
                M_Hhygl.krsj        = krsj;
                M_Hhygl.krsr        = Convert.ToDateTime(krsr);
                M_Hhygl.krxb        = krxb;
                M_Hhygl.krxm        = krxm;
                M_Hhygl.krzy        = krzy;
                M_Hhygl.hykh_bz     = hykh_bz;
                M_Hhygl.lzka        = lzka;
                M_Hhygl.qymc        = qymc;
                M_Hhygl.qzhm        = qzhm;
                M_Hhygl.qzrx        = qzrx;
                M_Hhygl.shxg        = Convert.ToBoolean(shxg);
                M_Hhygl.tjrq        = Convert.ToDateTime(tjrq);
                M_Hhygl.tlyxq       = Convert.ToDateTime(tlyxq);
                M_Hhygl.xgsj        = Convert.ToDateTime(xgsj);
                M_Hhygl.yxzj        = yxzj;
                M_Hhygl.parent_hykh = parent_hykh;
                M_Hhygl.hymm        = hymm;
                M_Hhygl.shqr        = true;
                M_Hhygl.xsy         = xsy;
                M_Hhygl.czy         = czy;
                if (B_Hhygl.Update(M_Hhygl))
                {
                    s = common_file.common_app.get_suc;
                }
            }
            else
            {
                if (add_edit_delete == common_file.common_app.get_delete)
                {
                    if (id != "")
                    {
                        Model.Hhygl M_Hhygl_new = B_Hhygl.GetModel(int.Parse(id));
                        if (M_Hhygl_new != null)
                        {
                            BLL.Common B_common = new Hotel_app.BLL.Common();
                            B_common.ExecuteSql(" delete from  Hhyjf_xfjl  where  hykh_bz='" + M_Hhygl_new.hykh_bz + "'");
                            B_common.ExecuteSql(" delete from  Hhyjf_df  where  hykh_bz='" + M_Hhygl_new.hykh_bz + "'");
                            B_Hhygl.Delete(Convert.ToInt32(id));
                        }
                        s = common_file.common_app.get_suc;
                    }
                }
            }
            return(s);
        }
Example #6
0
        //下载会员信息
        public static void DownLoad_Hygl()
        {
            BLL.Hhygl   B_Hhygl     = new BLL.Hhygl();
            Model.Hhygl M_Hhygl     = new Model.Hhygl();
            string      yydh        = common_file.Common.Getqyxx(1);
            string      s           = common_file.common_app.get_failure;
            DataSet     DS_download = new DataSet();
            int         rows        = 0;

            string csdatatime = "1800-01-01"; //远程传过来的初始时间
            string jsdatatime = "1800-01-01"; //远程传过来的结束时间

            url = common_file.Common.ReadXML("add", "url") + "/Hhygl/Hhygl_app.asmx";
            object[] args = new object[5];
            args[0] = yydh;
            args[1] = rows;
            args[2] = csdatatime;
            args[3] = jsdatatime;
            args[4] = DS_download;
            object result = jdgl_res_head_app.DynamicWebServiceCall.InvokeWebService(url, "Hhygl_download", args);

            if (result.ToString() == common_file.common_app.get_suc)
            {
                DS_download = (DataSet)args[4]; //下载好后把值传给本地数据库
                jsdatatime  = (String)args[3];  //读取结束时间
                csdatatime  = (String)args[2];  //读取初始时间
                foreach (DataRow dr in DS_download.Tables[0].Rows)
                {
                    string hykh_service = dr["hykh"].ToString();//读取会员卡号
                    M_Hhygl.yydh        = dr["yydh"].ToString();
                    M_Hhygl.qymc        = dr["qymc"].ToString();
                    M_Hhygl.hyrx        = dr["hyrx"].ToString();
                    M_Hhygl.hykh        = dr["hykh"].ToString();
                    M_Hhygl.hykh_bz     = dr["hykh_bz"].ToString();
                    M_Hhygl.krxm        = dr["krxm"].ToString();
                    M_Hhygl.krgj        = dr["krgj"].ToString();
                    M_Hhygl.krmz        = dr["krmz"].ToString();
                    M_Hhygl.yxzj        = dr["yxzj"].ToString();
                    M_Hhygl.zjhm        = dr["zjhm"].ToString();
                    M_Hhygl.krsr        = Convert.ToDateTime(dr["krsr"].ToString());
                    M_Hhygl.krdh        = dr["krdh"].ToString();
                    M_Hhygl.krsj        = dr["krsj"].ToString();
                    M_Hhygl.krEmail     = dr["krEmail"].ToString();
                    M_Hhygl.krdz        = dr["krdz"].ToString();
                    M_Hhygl.krzy        = dr["krzy"].ToString();
                    M_Hhygl.krdw        = dr["krdw"].ToString();
                    M_Hhygl.qzrx        = dr["qzrx"].ToString();
                    M_Hhygl.qzhm        = dr["qzhm"].ToString();
                    M_Hhygl.zjyxq       = Convert.ToDateTime(dr["zjyxq"].ToString());
                    M_Hhygl.tlyxq       = Convert.ToDateTime(dr["tlyxq"].ToString());
                    M_Hhygl.tjrq        = Convert.ToDateTime(dr["tjrq"].ToString());
                    M_Hhygl.lzka        = dr["lzka"].ToString();
                    M_Hhygl.bz          = dr["bz"].ToString();
                    M_Hhygl.djsj        = Convert.ToDateTime(dr["djsj"].ToString());
                    M_Hhygl.hyjf        = Convert.ToDecimal(dr["hyjf"].ToString());
                    M_Hhygl.shsc        = true;
                    M_Hhygl.scsj        = Convert.ToDateTime(jsdatatime);//取结束时间
                    M_Hhygl.xgsj        = Convert.ToDateTime(dr["xgsj"].ToString());
                    M_Hhygl.shxg        = false;
                    M_Hhygl.shqr        = true;
                    M_Hhygl.is_top      = Convert.ToBoolean(dr["is_top"].ToString());
                    M_Hhygl.is_select   = Convert.ToBoolean(dr["is_select"].ToString());
                    M_Hhygl.fkje        = Convert.ToDecimal(dr["fkje"].ToString());
                    M_Hhygl.parent_hykh = dr["parent_hykh"].ToString();   //主卡
                    M_Hhygl.czy         = dr["czy"].ToString();
                    M_Hhygl.xsy         = dr["xsy"].ToString();

                    //根据会员卡号读出相同的数据如果相同就修改,不然就直接下载到会员表

                    DataSet DS_Hhyglservice = new DataSet();
                    DS_Hhyglservice = B_Hhygl.GetList("hykh='" + hykh_service + "'");
                    if (DS_Hhyglservice != null && DS_Hhyglservice.Tables[0].Rows.Count > 0)
                    {
                        M_Hhygl.id = Convert.ToInt32(DS_Hhyglservice.Tables[0].Rows[0]["id"].ToString());
                        if (B_Hhygl.Update(M_Hhygl))
                        {
                            s = common_file.common_app.get_suc;
                        }
                    }
                    else
                    {
                        if (B_Hhygl.Add(M_Hhygl) > 0)
                        {
                            s = common_file.common_app.get_suc;
                        }
                    }
                }
                try
                {
                    common_file.Common_hygl.Update_hygljf(DS_download);//下载完后重新计算积分
                }
                catch
                { }
            }
            Common.AddMsg(DS_download, "下载会员信息记录");
        }
Example #7
0
        private void Save_hy()
        {
            common_file.common_app.get_czsj();
            string stryydh = common_file.common_app.yydh;
            string strqymc = common_file.common_app.qymc;
            string url     = common_file.common_app.service_url + "Hhygl/Hhygl_app.asmx";

            //状态为空的时候(为新增记录),生成临时编号
            if (add_edit == common_file.common_app.get_add && tB_hykh_bz.Text.Trim() != "")
            {
                hykh = common_file.common_ddbh.ddbh("hy", "hydate", "hycounter", 6);
            }
            if (add_edit == common_file.common_app.get_edit && tB_hykh_bz.Text.Trim() != "")
            {
                hykh    = M_Hhygl.hykh;
                hymm    = M_Hhygl.hymm;//读取会员密码
                stryydh = M_Hhygl.yydh;
                strqymc = M_Hhygl.qymc;
            }
            string[] args = new string[35];
            args[0]  = Hhygl_id.ToString();
            args[1]  = stryydh;
            args[2]  = strqymc;
            args[3]  = hykh;
            args[4]  = cB_hyrx.Text.Trim().Replace("'", "-");
            args[5]  = tB_hykh_bz.Text.Trim().Replace("'", "-");
            args[6]  = tB_krxm.Text.Trim().Replace("'", "-");
            args[7]  = tB_krgj.Text.Trim().Replace("'", "-");
            args[8]  = tB_krmz.Text.Trim().Replace("'", "-");
            args[9]  = tB_yxzj.Text.Trim().Replace("'", "-");
            args[10] = tB_zjhm.Text.Trim().Replace("'", "-");
            args[11] = dT_krsr.Text.Trim().Replace("'", "-");
            args[12] = cB_krxb.Text.Trim().Replace("'", "-");
            args[13] = tB_krdh.Text.Trim().Replace("'", "-");
            args[14] = tB_krsj.Text.Trim().Replace("'", "-");
            args[15] = tB_krEmail.Text.Trim().Replace("'", "-");
            args[16] = tB_krdz.Text.Trim().Replace("'", "-");
            args[17] = tB_krzy.Text.Trim().Replace("'", "-");
            args[18] = tB_krdw.Text.Trim().Replace("'", "-");
            args[19] = tB_qzrx.Text.Trim().Replace("'", "-");
            args[20] = tB_qzhm.Text.Trim().Replace("'", "-");
            args[21] = dT_zjyxq.Text.Trim().Replace("'", "-");
            args[22] = dT_tlyxq.Text.Trim().Replace("'", "-");
            args[23] = dT_tjrq.Text.Trim().Replace("'", "-");
            args[24] = tB_lzka.Text.Trim().Replace("'", "-");
            args[25] = tB_bz.Text.Trim().Replace("'", "-");
            args[26] = tB_hyjf.Text.Trim().Replace("'", "-");
            if (add_edit == common_file.common_app.get_add)
            {
                args[27] = "false";
                args[28] = common_file.common_app.cssj;
            }
            else
            {
                args[27] = "true";
                args[28] = DateTime.Now.ToString(); //DateTime.Now.ToShortDateString();
            }
            args[29] = p_hykh;                      //主卡
            args[30] = hymm;                        //密码
            args[31] = tB_xsy.Text.Trim().Replace("'", "-");
            args[32] = common_file.common_app.czy;
            args[33] = add_edit;
            args[34] = common_file.common_app.xxzs;

            string result = common_file_server.common_app.get_failure;

            Hotel_app.Server.Hhygl.Hhygl_add_edit Hhygl_add_edit_services = new Hotel_app.Server.Hhygl.Hhygl_add_edit();
            try
            {
                result = Hhygl_add_edit_services.Hhygl_add_edit_delete_app(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(), args[19].ToString(), args[20].ToString(), args[21].ToString(),
                                                                           args[22].ToString(), args[23].ToString(), args[24].ToString(), args[25].ToString(), args[26].ToString(), args[27].ToString(), args[28].ToString(), args[29].ToString(),
                                                                           args[30].ToString(), args[31].ToString(), args[32].ToString(), args[33].ToString(), args[34].ToString());
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
            }

            //object result = Hotel_app.我的替换DynamicWebServiceCall.InvokeWebService(url, "Hhygl_add_edit_delete_app", args);
            if (result != null && result == common_file.common_app.get_suc)
            {
                if (add_edit == common_file.common_app.get_add)
                {
                    common_file.common_czjl.add_czjl(stryydh, strqymc, common_file.common_app.czy, "新增会员成功", "" + tB_hykh_bz.Text + "", "", DateTime.Now);
                    String  s_ma_rem   = "新增会员成功!";
                    DataSet ds_temp_09 = B_Common.GetList("select * from Qcounter", " 1=1  ");
                    if (ds_temp_09 != null && ds_temp_09.Tables[0].Rows.Count > 0)
                    {
                        if (bool.Parse(ds_temp_09.Tables[0].Rows[0]["Hhygl_qyqr"].ToString()) == true)
                        {
                            s_ma_rem = s_ma_rem + "目前会员还没验证,还不能正常使用,请及时发送验证码给客人进行验证!";
                        }
                    }
                    common_file.common_app.Message_box_show(common_file.common_app.message_title, s_ma_rem);
                    add_edit = common_file.common_app.get_edit;//保存完后修改成修改状态
                    //并立即加载成当前的新增的会员信息
                    List <Model.Hhygl> list_current = B_Hhygl.GetModelList("  id>=0  and   hykh_bz='" + tB_hykh_bz.Text.Trim() + "'");
                    if (list_current != null && list_current.Count > 0)
                    {
                        M_Hhygl  = list_current[0];
                        Hhygl_id = M_Hhygl.id.ToString();
                    }
                    common_file.common_hy.Hhygl_browse_new.refresh_app();
                    return;
                    //clear_main_infor();//清空数据,如果要继续新增就要启用这个,注释掉状态的修改
                }
                if (add_edit == common_file.common_app.get_edit)
                {
                    common_file.common_czjl.add_czjl(stryydh, strqymc, common_file.common_app.czy, "修改会员成功", "" + tB_hykh_bz.Text + "", "", DateTime.Now);
                    common_file.common_app.Message_box_show(common_file.common_app.message_title, "修改成功.");
                    if (common_file.common_hy.Hhygl_browse_new != null)
                    {
                        common_file.common_hy.Hhygl_browse_new.refresh_app();
                    }
                }
                common_file.common_hy.Hhygl_browse_new.refresh_app();
                return;
            }
            else
            {
                common_file.common_app.Message_box_show(common_file.common_app.message_title, "操作失败.");
            }
        }