Ejemplo n.º 1
0
        private bool Save(Framework.Task.Task task, ref string errmsg)
        {
            bool      result  = true;
            BaseDao   baseDao = new BaseDao();
            XtmConfig entity  = task.Entity as XtmConfig;

            if (entity.Config1 == "")
            {
                errmsg = "结账日不能为空";
                return(false);
            }
            try
            {
                int temp = int.Parse(entity.Config1);
                if (temp < 0 || temp > 28)
                {
                    errmsg = "结账日只能在1到28号之间";
                    return(false);
                }
            }
            catch
            {
                errmsg = "结账日不正确,应该是整数";
                return(false);
            }
            baseDao.Update(entity);
            errmsg = "保存成功";
            return(result);
        }
Ejemplo n.º 2
0
        void WatchTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            if (running == true)
            {
                try
                {
                    WatchTimer.Enabled = false;
                    running            = false;
                    int startTime = int.Parse(System.Configuration.ConfigurationManager.AppSettings["startTime"].ToString());
                    if (DateTime.Now.Hour > startTime)
                    {
                        BaseDao   baseDao = new BaseDao();
                        XtmConfig config  = new XtmConfig();
                        config = baseDao.Get(config);
                        bool result = false;

                        if (DateTime.Now.Day >= int.Parse(config.Config1))
                        {
                            if (config.Config3 == "")
                            {
                                result = true;
                            }
                            else
                            {
                                DateTime st1 = DateTime.Parse(config.Config3);
                                DateTime st2 = DateTime.Parse("" + DateTime.Now.Year + "-" + DateTime.Now.Month + "-01").AddMonths(-1);
                                if (st1.CompareTo(st2) == 0)
                                {
                                    result = false;
                                }
                                else
                                {
                                    result = true;
                                }
                            }
                        }
                        if (result == true)
                        {
                            DealJZ();
                        }
                    }
                }
                catch (Exception ex)
                {
                    string str = ex.Message;
                }
                finally
                {
                    WatchTimer.Enabled = true;
                    running            = true;
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 创建实体后期动作
 /// </summary>
 public override void AfterCreateEntity()
 {
     base.AfterCreateEntity();
     if (!IsPostBack)
     {
         BaseDao   baseDao = new BaseDao();
         XtmConfig config  = new XtmConfig();
         config = baseDao.Get(config);
         int jzr = int.Parse(config.Config1);
         if (DateTime.Now.Day > jzr)
         {
             this.Entity.BegD = DateTime.Parse("" + DateTime.Now.Year + "-" + DateTime.Now.Month + "-01");
         }
         else
         {
             DateTime dtt = DateTime.Now.AddMonths(-1);
             this.Entity.BegD = DateTime.Parse("" + dtt.Year + "-" + dtt.Month + "-01");
         }
         this.Entity.GetOpType = "CwConfrimList";
     }
 }