コード例 #1
0
        public string Hhyjfxfjl_UploadDS(DataSet DS_Hhyjfxfjl)  //上传积分消费记录
        {
            //id,qymc,yydh,lsbh_df,hykh,hykh_bz,krxm,id_app,lsbh,fjrb,fjbh,xfsj,hyjf,bz,xfdr,xfrb,xfxm,sjxmje,shsc,scsj,is_top,is_select,shqx
            string s = common_file.common_app.get_failure;

            BLL.Hhyjf_xfjl   B_Hhyjf_xfjl = new BLL.Hhyjf_xfjl();
            Model.Hhyjf_xfjl M_Hhyjf_xfjl = new Model.Hhyjf_xfjl();
            if (DS_Hhyjfxfjl != null && DS_Hhyjfxfjl.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in DS_Hhyjfxfjl.Tables[0].Rows)
                {
                    string hykh_service = dr["lsbh_df"].ToString();

                    M_Hhyjf_xfjl.qymc        = dr["qymc"].ToString();
                    M_Hhyjf_xfjl.yydh        = dr["yydh"].ToString();
                    M_Hhyjf_xfjl.lsbh_df     = dr["lsbh_df"].ToString();
                    M_Hhyjf_xfjl.hykh        = dr["hykh"].ToString();
                    M_Hhyjf_xfjl.hykh_bz     = dr["hykh_bz"].ToString();
                    M_Hhyjf_xfjl.krxm        = dr["krxm"].ToString();
                    M_Hhyjf_xfjl.id_app      = dr["id_app"].ToString();
                    M_Hhyjf_xfjl.lsbh        = dr["lsbh"].ToString();
                    M_Hhyjf_xfjl.fjrb        = dr["fjrb"].ToString();
                    M_Hhyjf_xfjl.fjbh        = dr["fjbh"].ToString();
                    M_Hhyjf_xfjl.xfsj        = Convert.ToDateTime(dr["xfsj"].ToString());
                    M_Hhyjf_xfjl.hyjf        = Convert.ToDecimal(dr["hyjf"].ToString());
                    M_Hhyjf_xfjl.bz          = dr["bz"].ToString();
                    M_Hhyjf_xfjl.xfdr        = dr["xfdr"].ToString();
                    M_Hhyjf_xfjl.xfrb        = dr["xfrb"].ToString();
                    M_Hhyjf_xfjl.xfxm        = dr["xfxm"].ToString();
                    M_Hhyjf_xfjl.sjxfje      = Convert.ToDecimal(dr["sjxfje"].ToString());
                    M_Hhyjf_xfjl.shsc        = true;
                    M_Hhyjf_xfjl.scsj        = DateTime.Now;
                    M_Hhyjf_xfjl.shqx        = Convert.ToBoolean(dr["shqx"].ToString());
                    M_Hhyjf_xfjl.xfrq        = Convert.ToDateTime(dr["xfrq"].ToString());
                    M_Hhyjf_xfjl.parent_hykh = dr["parent_hykh"].ToString();

                    DataSet DS_Hhyglservice = new DataSet();
                    DS_Hhyglservice = B_Hhyjf_xfjl.GetList("lsbh_df='" + hykh_service + "'");
                    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_xfjl.Delete(strid))
                        {
                            s = common_file.common_app.get_suc;
                        }
                    }

                    B_Hhyjf_xfjl.Add(M_Hhyjf_xfjl);
                    s = common_file.common_app.get_suc;
                }
            }
            return(s);
        }
コード例 #2
0
        //下载会员积分消费记录
        public static void DownLoad_hyjf_xfjl()
        {
            BLL.Hhyjf_xfjl   B_Hhyjf_xfjl = new BLL.Hhyjf_xfjl();
            Model.Hhyjf_xfjl M_Hhyjf_xfjl = new Model.Hhyjf_xfjl();
            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, "Hhyjfxfjl_download", args);

            jsdatatime = (String)args[3];  //读取结束时间
            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)
                {
                    //id,qymc,yydh,lsbh_df,hykh,hykh_bz,krxm,id_app,lsbh,fjrb,fjbh,xfsj,hyjf,bz,xfdr,xfrb,xfxm,sjxmje,shsc,scsj,is_top,is_select,shqx
                    string hykh_service = dr["lsbh_df"].ToString();
                    M_Hhyjf_xfjl.yydh        = dr["yydh"].ToString();
                    M_Hhyjf_xfjl.lsbh_df     = dr["lsbh_df"].ToString();
                    M_Hhyjf_xfjl.qymc        = dr["qymc"].ToString();
                    M_Hhyjf_xfjl.hykh        = dr["hykh"].ToString();
                    M_Hhyjf_xfjl.hykh_bz     = dr["hykh_bz"].ToString();
                    M_Hhyjf_xfjl.krxm        = dr["krxm"].ToString();
                    M_Hhyjf_xfjl.id_app      = dr["id_app"].ToString();
                    M_Hhyjf_xfjl.lsbh        = dr["lsbh"].ToString();
                    M_Hhyjf_xfjl.fjrb        = dr["fjrb"].ToString();
                    M_Hhyjf_xfjl.fjbh        = dr["fjbh"].ToString();
                    M_Hhyjf_xfjl.xfsj        = Convert.ToDateTime(dr["xfsj"].ToString());
                    M_Hhyjf_xfjl.hyjf        = Convert.ToDecimal(dr["hyjf"].ToString());
                    M_Hhyjf_xfjl.bz          = dr["bz"].ToString();
                    M_Hhyjf_xfjl.xfdr        = dr["xfdr"].ToString();
                    M_Hhyjf_xfjl.xfrb        = dr["xfrb"].ToString();
                    M_Hhyjf_xfjl.xfxm        = dr["xfxm"].ToString();
                    M_Hhyjf_xfjl.sjxfje      = Convert.ToDecimal(dr["sjxfje"].ToString());
                    M_Hhyjf_xfjl.shsc        = true;
                    M_Hhyjf_xfjl.scsj        = Convert.ToDateTime(csdatatime);//取初始时间
                    M_Hhyjf_xfjl.shqx        = Convert.ToBoolean(dr["shqx"].ToString());
                    M_Hhyjf_xfjl.parent_hykh = dr["parent_hykh"].ToString();
                    M_Hhyjf_xfjl.xfrq        = Convert.ToDateTime(dr["xfrq"].ToString());

                    DataSet DS_Hhyglservice = new DataSet();
                    DS_Hhyglservice = B_Hhyjf_xfjl.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_xfjl.Delete(strid))
                        {
                            ss = common_file.common_app.get_suc;
                        }
                    }


                    if (B_Hhyjf_xfjl.Add(M_Hhyjf_xfjl) > 0)
                    {
                        ss = common_file.common_app.get_suc;
                    }
                }
                try
                {
                    common_file.Common_hygl.Update_hygljf(DS_download);//下载完后重新计算积分
                }
                catch
                { }
            }
            common_file.Common_hygl.DownLoadUpdate(jsdatatime);//用于下载成功后修改远程服务下载时间
            Common.AddMsg(DS_download, "下载会员积分消费");
        }