Example #1
0
    public int GetTGIncome(string userid)
    {
        string tgIncome    = new BLL.Promotion().GetTGIncomeMoney(userid);
        string tgPayIncome = new BLL.Promotion().GetTGPayIncomeMoney(userid);

        return(Convert.ToInt32(tgIncome) + Convert.ToInt32(tgPayIncome));
    }
Example #2
0
        public void BindTgInfo()
        {
            DataRow dr = new BLL.Promotion().GetInfo(UiCommon.UserLoginInfo.UserID);

            if (dr != null)
            {
                lteTrueName.Text = dr["TrueName"].ToString();
                lteTgMoney.Text  = UiCommon.StringConfig.AddZeros(dr["MoneyCount"]);
            }

            DataRow dr2 = BLL.Config.GetInfoOfPromotion();

            if (dr2 != null)
            {
                //推广收入结账最低要达到的金币数
                lteCon_MinClearingMoney.Text = UiCommon.StringConfig.AddZeros(dr2["Con_MinClearingMoney"]);
            }
        }
Example #3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            DTcms.BLL.Promotion bll             = new BLL.Promotion();
            BLL.Client          bllClient       = new BLL.Client();
            BLL.GoodCategory    bllGoodCategory = new BLL.GoodCategory();
            BLL.BarCode         bllbarcode      = new BLL.BarCode();
            string type = context.Request.QueryString["type"];

            switch (type)
            {
            case "select":
                int pageIndex = int.Parse(context.Request.Form["page"].ToString());
                int pageSize  = int.Parse(context.Request.Form["rows"].ToString());
                try
                {
                    int                  recordCount = 0;
                    Model.manager        adminmodel  = context.Session[DTKeys.SESSION_ADMIN_INFO] as Model.manager;
                    DataSet              ds          = bll.GetList(pageSize, pageIndex, "m.id=" + adminmodel.id, "PromotionID", out recordCount);
                    DataTable            dt          = ds.Tables[0];
                    string               result      = "";
                    IsoDateTimeConverter timeFormat  = new IsoDateTimeConverter();
                    timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
                    result = JsonConvert.SerializeObject(dt, new DataTableConverter(), timeFormat);
                    context.Response.Write("{\"total\":" + "\"" + recordCount + "\"" + ",\"rows\":" + result + "}");
                }
                catch (Exception)
                {
                }
                break;

            case "del":
                bll.Delete(context.Request.QueryString["ids"]);
                break;
            }
        }
Example #4
0
 public int GetTGIncome(string userid)
 {
     string tgIncome = new BLL.Promotion().GetTGIncomeMoney(userid);
     string tgPayIncome = new BLL.Promotion().GetTGPayIncomeMoney(userid);
     return (Convert.ToInt32(tgIncome) + Convert.ToInt32(tgPayIncome));
 }
Example #5
0
        public void BindTgInfo()
        {
            DataRow dr = new BLL.Promotion().GetInfo(UiCommon.UserLoginInfo.UserID);
            if (dr != null)
            {
                lteTrueName.Text = dr["TrueName"].ToString();
                lteTgMoney.Text = UiCommon.StringConfig.AddZeros(dr["MoneyCount"]);
            }

            DataRow dr2 = BLL.Config.GetInfoOfPromotion();
            if (dr2 != null)
            {
                //�ƹ�����������Ҫ�ﵽ�Ľ����
                lteCon_MinClearingMoney.Text = UiCommon.StringConfig.AddZeros(dr2["Con_MinClearingMoney"]);

            }
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            List <Model.Promotion> list = new List <Model.Promotion>();
            string type = context.Request.QueryString["type"];

            BLL.Promotion bll = new BLL.Promotion();
            BLL.BarCode   bb  = new BLL.BarCode();
            switch (type)
            {
            case "one":

                if (context.Request.QueryString["code"] == null || context.Request.QueryString["code"] == "undefined" || context.Request.QueryString["code"] == "")
                {
                    if (context.Cache["key"] != null)
                    {
                        list = (List <Model.Promotion>)context.Cache["key"];
                        IsoDateTimeConverter timeFormat = new IsoDateTimeConverter();
                        timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
                        context.Response.Write(JsonConvert.SerializeObject(list));
                    }
                }
                else
                {
                    Model.manager   adminmodel = context.Session[DTKeys.SESSION_ADMIN_INFO] as Model.manager;
                    Model.Promotion model      = new Model.Promotion();
                    //model.ClientID = 0;
                    model.UniqueID       = Guid.NewGuid();
                    model.LogisticsCode  = context.Request.QueryString["code"];
                    model.Operator       = adminmodel.id;
                    model.State          = 3;
                    model.BrokerageRatio = 0;
                    model.CreateTime     = Convert.ToDateTime(DateTime.Now);
                    model.Remark         = string.Empty;

                    if (context.Cache["key"] == null)
                    {
                        list.Add(model);
                        context.Cache["key"] = list;
                    }
                    else
                    {
                        list = (List <Model.Promotion>)context.Cache["key"];
                        list.Add(model);
                    }

                    try
                    {
                        //if (bb.ExistsOut(context.Request.QueryString["code"]))
                        //{

                        if (bll.Add(model, true))
                        {
                            IsoDateTimeConverter timeFormat = new IsoDateTimeConverter();
                            timeFormat.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
                            context.Response.Write(JsonConvert.SerializeObject(list, timeFormat));
                        }
                        //}
                    }
                    catch (Exception)
                    {
                    }
                }
                break;

            case "two":
                Common.ComExcelHelper ch = new Common.ComExcelHelper();
                DataTable             dt = new DataTable();
                dt = ch.ReadExcel2DataTable(context.Server.MapPath("/DownLoad/") + context.Request.QueryString["filename"], "nihao", "物流码");
                dt.Rows.RemoveAt(0);
                dt.Columns.Add("UniqueID", typeof(Guid));
                //dt.Columns.Add("ClientID", typeof(Int32));
                dt.Columns.Add("Operator", typeof(Int32));
                dt.Columns.Add("CreateTime", typeof(DateTime));
                dt.Columns.Add("State", typeof(Int32));
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dt.Rows[i][1] = Guid.NewGuid();
                    dt.Rows[i][2] = 1;
                    dt.Rows[i][3] = DateTime.Now;
                    dt.Rows[i][4] = 3;
                    if (dt.Rows[i][0] == null || dt.Rows[i][0].ToString() == "")
                    {
                        dt.Rows.RemoveAt(i);
                    }
                }
                Dictionary <string, string> dic = new Dictionary <string, string>();
                dic.Add("UniqueID", "UniqueID");
                //dic.Add("ClientID", "ClientID");
                dic.Add("物流码", "LogisticsCode");
                dic.Add("Operator", "Operator");
                dic.Add("CreateTime", "CreateTime");
                dic.Add("State", "State");
                string json = "";
                try
                {
                    bll.Add(dt, "TempPromotion", dic);
                }
                catch (Exception)
                {}
                try
                {
                    bll.Add(dt, "Promotion", dic);
                    IsoDateTimeConverter timeFormat2 = new IsoDateTimeConverter();
                    int total = dt.Rows.Count;
                    timeFormat2.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
                    dt   = GetPagedTable(dt, Convert.ToInt32(context.Request.Form["page"]), Convert.ToInt32(context.Request.Form["rows"]));
                    json = JsonConvert.SerializeObject(dt, new DataTableConverter(), timeFormat2);
                    json = "{\"total\":" + "\"" + total + "\"" + ",\"rows\":" + json + "}";
                }
                catch (Exception)
                {
                    json = "{\"total\":" + "\"0\"" + ",\"rows\":[]}";
                }
                finally
                {
                    context.Response.Write(json);
                }
                break;

            case "Three":
                try
                {
                    if (bb.ExistsOut(context.Request.QueryString["code"]))
                    {
                        context.Response.Write("true");
                    }
                    else
                    {
                        context.Response.Write("false");
                    }
                }
                catch (Exception)
                {
                }
                break;
            }
        }