Esempio n. 1
0
 private void b_dfxm_Click(object sender, EventArgs e)
 {
     try
     {
         if (tB_classname.Text != "")
         {
             display_new_commonform_1("Hhyjf_jp", tB_title.Left + 150, tB_title.Top + 100, tB_title, tB_classname.Text);
             //通过消费小类名称和消费项目的名称,检索价格,数量默认1
             M_Hhyjfjp    = B_Hhyjfjp.GetModelList("classname='" + tB_classname.Text.Trim() + "'  and id>=0  " + common_file.common_app.yydh_select + "  and   title='" + tB_title.Text.Trim() + "'")[0];
             tB_dfsl.Text = "1.0";
             tB_dfjf.Text = ((M_Hhyjfjp.jpjf) * (Decimal.Parse(tB_dfsl.Text))).ToString();
         }
         else
         {
             common_file.common_app.Message_box_show(common_file.common_app.message_title, "对不起,项目类型不能为空");
             tB_classname.Focus();
         }
     }
     catch
     { }
 }
Esempio n. 2
0
        //奖品奖励信息下载,供特定门店下载返回dataset
        public DataSet DSHhyjfjp_download(string yydh, out int rows, out string csdatatime, out string jsdatatime)
        {
            BLL.Hhyjf_jp       B_Hhyjf_jp = new BLL.Hhyjf_jp();
            Model.Hhyjf_jp     M_Hhyjf_jp = new Model.Hhyjf_jp();
            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_jp = new DataSet();

            rows       = 0;
            jsdatatime = jstime;
            csdatatime = cstime.ToString();
            //status = false;
            //msg = "没有查到要下载的数据信息或者远程服务器出错";
            DS_Hhyjf_jp = B_Hhyjf_jp.GetList(200, "yydh='" + yydh + "'", "id");

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

            return(DS_Hhyjf_jp);
        }
Esempio n. 3
0
        //下载会员奖品
        public static void DownLoad_hyjf_jp()
        {
            BLL.Hhyjf_jp   B_Hhyjf_jp  = new BLL.Hhyjf_jp();
            Model.Hhyjf_jp M_Hhyjf_jp  = new Model.Hhyjf_jp();
            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, "Hhyjfjp_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)
                {
                    //ID,yydh,qymc,classname,Title,jpjf,simg,bimg,info,bz,isTuiJian,isshow,shsc,hyjfrx,is_top,is_select
                    string hykh_service = dr["title"].ToString();
                    string strclassname = dr["classname"].ToString();
                    M_Hhyjf_jp.yydh      = dr["yydh"].ToString();
                    M_Hhyjf_jp.qymc      = dr["qymc"].ToString();
                    M_Hhyjf_jp.classname = strclassname;
                    M_Hhyjf_jp.Title     = hykh_service;
                    M_Hhyjf_jp.jpjf      = Convert.ToDecimal(dr["jpjf"].ToString());
                    M_Hhyjf_jp.simg      = dr["simg"].ToString();
                    M_Hhyjf_jp.bimg      = dr["bimg"].ToString();
                    M_Hhyjf_jp.info      = dr["info"].ToString();
                    M_Hhyjf_jp.bz        = dr["bz"].ToString();
                    M_Hhyjf_jp.shsc      = true;
                    M_Hhyjf_jp.hyjfrx    = dr["hyjfrx"].ToString();



                    DataSet DS_Hhyglservice = new DataSet();
                    DS_Hhyglservice = B_Hhyjf_jp.GetList("title='" + hykh_service + "' and classname='" + strclassname + "'");
                    //根据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());
                        M_Hhyjf_jp.ID = strid;
                        if (B_Hhyjf_jp.Update(M_Hhyjf_jp))
                        {
                            ss = common_file.common_app.get_suc;
                        }
                    }
                    else
                    {
                        if (B_Hhyjf_jp.Add(M_Hhyjf_jp) > 0)
                        {
                            ss = common_file.common_app.get_suc;
                        }
                    }
                }
                Common.AddMsg(DS_download, "下载会员奖品记录");
            }
        }