Exemplo n.º 1
0
        public static void ResetStatus(string id)
        {
            var         entities = FormulaHelper.GetEntities <OfficeAutoEntities>();
            S_D_Posting model    = entities.Set <S_D_Posting>().Find(id);

            if (model != null)
            {
                //model.Status = PostingStatus.Draft.ToString();
                // model.InsFlowID = null;
                // model.ExecutedSteps = null;
                entities.SaveChanges();
            }
        }
Exemplo n.º 2
0
        public static void ChangeStatus(string id, string status)
        {
            var         entities = FormulaHelper.GetEntities <OfficeAutoEntities>();
            S_D_Posting model    = entities.Set <S_D_Posting>().Find(id);

            if (model != null && !string.IsNullOrEmpty(status))
            {
                PostingStatus enumStatus = (PostingStatus)Enum.Parse(typeof(PostingStatus), status);
                if (enumStatus.ToString() != string.Empty)
                {
                    //model.Status = enumStatus.ToString();
                    //if (!string.IsNullOrEmpty(model.ExecutedSteps))
                    //{
                    //    string[] arr = model.ExecutedSteps.Split(',');
                    //    arr.RemoveWhere(c => c == enumStatus.ToString());
                    //    model.ExecutedSteps = string.Join(",", arr);
                    //}
                    entities.SaveChanges();
                }
            }
        }