Exemplo n.º 1
0
        public string Hhyjfdf_UploadDS(DataSet DS_Hhyjfdf)  //上传积分兑换
        {
            //id,yydh,qymc,lsbh_df,hykh,hykh_bz,krxm,dfjf,dfxm,dfsl,xfsj,shsc,scsj,is_top,is_select,shqx
            string s = common_file.common_app.get_failure;

            BLL.Hhyjf_df   B_Hhyjf_df = new BLL.Hhyjf_df();
            Model.Hhyjf_df M_Hhyjf_df = new Model.Hhyjf_df();
            if (DS_Hhyjfdf != null && DS_Hhyjfdf.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in DS_Hhyjfdf.Tables[0].Rows)
                {
                    string hykh_service = dr["lsbh_df"].ToString();


                    M_Hhyjf_df.yydh    = dr["yydh"].ToString();
                    M_Hhyjf_df.lsbh_df = dr["lsbh_df"].ToString();
                    M_Hhyjf_df.qymc    = dr["qymc"].ToString();
                    M_Hhyjf_df.hykh    = dr["hykh"].ToString();
                    M_Hhyjf_df.hykh_bz = dr["hykh_bz"].ToString();
                    M_Hhyjf_df.krxm    = dr["krxm"].ToString();
                    M_Hhyjf_df.dfjf    = Convert.ToDecimal(dr["dfjf"].ToString());
                    M_Hhyjf_df.dfxm    = dr["dfxm"].ToString();
                    M_Hhyjf_df.dfsl    = Convert.ToDecimal(dr["dfsl"].ToString());
                    M_Hhyjf_df.xfsj    = Convert.ToDateTime(dr["xfsj"].ToString());
                    M_Hhyjf_df.shsc    = true;
                    M_Hhyjf_df.scsj    = DateTime.Now;
                    M_Hhyjf_df.shqx    = Convert.ToBoolean(dr["shqx"].ToString());
                    M_Hhyjf_df.xfrq    = Convert.ToDateTime(dr["xfrq"].ToString());

                    DataSet DS_Hhyglservice = new DataSet();
                    DS_Hhyglservice = B_Hhyjf_df.GetList("lsbh_df='" + hykh_service + "'");
                    //根据Lsbh_df查询出有没有相同的记录,如果有先删除在加。
                    if (DS_Hhyglservice != null && DS_Hhyglservice.Tables[0].Rows.Count > 0)
                    {
                        int strid = Convert.ToInt32(DS_Hhyglservice.Tables[0].Rows[0]["id"].ToString());
                        if (B_Hhyjf_df.Delete(strid))
                        {
                            s = common_file.common_app.get_suc;
                        }
                    }

                    B_Hhyjf_df.Add(M_Hhyjf_df);
                    s = common_file.common_app.get_suc;
                }
            }
            return(s);
        }
Exemplo n.º 2
0
        //会员兑换信息下载,供特定门店下载返回dataset
        public DataSet DSHhyjfdf_download(string yydh, out int rows, out string csdatatime, out string jsdatatime)
        {
            BLL.Hhyjf_df       B_Hhyjf_df = new BLL.Hhyjf_df();
            Model.Hhyjf_df     M_Hhyjf_df = new Model.Hhyjf_df();
            Model.Hhy_sc_xz_sj M_Hhyscsj  = new Model.Hhy_sc_xz_sj();
            BLL.Hhy_sc_xz_sj   B_Hhyscsj  = new BLL.Hhy_sc_xz_sj();

            //查询出上次上传时间
            DateTime cstime = Convert.ToDateTime("1800-01-01");

            if (yydh != "" && yydh != null)
            {
                M_Hhyscsj = B_Hhyscsj.GetModelList("yydh='" + yydh + "'")[0];
                cstime    = M_Hhyscsj.hy_scsj;
            }
            string  jstime      = DateTime.Now.ToString();
            DataSet DS_Hhyjf_df = new DataSet();

            rows       = 0;
            jsdatatime = jstime;
            csdatatime = cstime.ToString();
            //status = false;
            //msg = "没有查到要下载的数据信息或者远程服务器出错";
            DS_Hhyjf_df = B_Hhyjf_df.GetList("yydh<>'" + yydh + "' and scsj>='" + cstime + "' and scsj<'" + jstime + "'");

            if (DS_Hhyjf_df != null)
            {
                rows       = DS_Hhyjf_df.Tables[0].Rows.Count;
                jsdatatime = jstime;
                csdatatime = cstime.ToString();
                //status = true;
                //msg = "查询成功";
            }

            return(DS_Hhyjf_df);
        }
Exemplo n.º 3
0
        //下载会员兑换记录
        public static void DownLoad_hyjf_df()
        {
            BLL.Hhyjf_df   B_Hhyjf_df  = new BLL.Hhyjf_df();
            Model.Hhyjf_df M_Hhyjf_df  = new Model.Hhyjf_df();
            int            rows        = 0;
            string         csdatatime  = "1800-01-01";
            string         jsdatatime  = "1800-01-01";
            DataSet        DS_download = new DataSet();

            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, "Hhyjfdf_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["lsbh_df"].ToString();
                    M_Hhyjf_df.yydh    = dr["yydh"].ToString();
                    M_Hhyjf_df.lsbh_df = dr["lsbh_df"].ToString();
                    M_Hhyjf_df.qymc    = dr["qymc"].ToString();
                    M_Hhyjf_df.hykh    = dr["hykh"].ToString();
                    M_Hhyjf_df.hykh_bz = dr["hykh_bz"].ToString();
                    M_Hhyjf_df.krxm    = dr["krxm"].ToString();
                    M_Hhyjf_df.dfjf    = Convert.ToDecimal(dr["dfjf"].ToString());
                    M_Hhyjf_df.dfxm    = dr["dfxm"].ToString();
                    M_Hhyjf_df.dfsl    = Convert.ToDecimal(dr["dfsl"].ToString());
                    M_Hhyjf_df.xfsj    = Convert.ToDateTime(dr["xfsj"].ToString());
                    M_Hhyjf_df.shsc    = true;
                    M_Hhyjf_df.scsj    = Convert.ToDateTime(csdatatime);//取初始时间
                    M_Hhyjf_df.xfrq    = Convert.ToDateTime(dr["xfrq"].ToString());

                    M_Hhyjf_df.shqx = Convert.ToBoolean(dr["shqx"].ToString());
                    M_Hhyjf_df.xfrq = Convert.ToDateTime(dr["xfrq"].ToString());
                    DataSet DS_Hhyglservice = new DataSet();
                    DS_Hhyglservice = B_Hhyjf_df.GetList("lsbh_df='" + hykh_service + "'");
                    //根据Lsbh_df查询出有没有相同的记录,如果有先删除在加。
                    if (DS_Hhyglservice != null && DS_Hhyglservice.Tables[0].Rows.Count > 0)
                    {
                        int strid = Convert.ToInt32(DS_Hhyglservice.Tables[0].Rows[0]["id"].ToString());
                        if (B_Hhyjf_df.Delete(strid))
                        {
                            ss = common_file.common_app.get_suc;
                        }
                    }

                    if (B_Hhyjf_df.Add(M_Hhyjf_df) > 0)
                    {
                        ss = common_file.common_app.get_suc;
                    }
                }
                try
                {
                    common_file.Common_hygl.Update_hygljf(DS_download);//下载完后重新计算积分
                }
                catch
                { }
                Common.AddMsg(DS_download, "下载会员兑换记录");
            }
        }