Exemplo n.º 1
0
        private async Task ExecuteDeleteFormCommand(object _itemToDelete)
        {
            if (IsBusy)
            {
                return;
            }

            DeleteFormCommand.ChangeCanExecute();
            var item = _itemToDelete as FormItem;

            var res = await page.DisplayAlert("Delete Item ", item.FirstName + "?", "OK", "Cancel");


            if (res)
            {
                IsBusy = true;

                var _deleted = await App.azureService.DeleteForm(item);

                if (_deleted == "SUCCESS")
                {
                    FormList.Remove(item);
                }
                else
                {
                    await page.DisplayAlert("Oh No!", "Could not delete item, please check your connection", "OK");
                }
                IsBusy = false;
            }
        }
Exemplo n.º 2
0
        private void list_button_Click(object sender, EventArgs e)
        {
            FormList window = new FormList(this);

            sortByDate();
            window.ShowDialog();
        }
Exemplo n.º 3
0
        /// <summary>
        /// 修改
        /// </summary>
        public override void EntityUpdate()
        {
            FormListRule rule   = new FormListRule();
            FormList     entity = EntityGet();

            rule.RUpdate(entity);
        }
Exemplo n.º 4
0
        /*
         *  private void frmChild_FormClosing(object sender, FormClosingEventArgs e)
         *  {
         *      if (e.CloseReason != CloseReason.MdiFormClosing)
         *      {
         *          e.Cancel = true;
         *      }
         *  }
         */
        #endregion

        #endregion



        /// <summary>
        /// 弹出选择单位帮助处理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonEditDW_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            //MessageBox.Show("1asdf");

            FormDW frm = new FormDW();

            frm.StartPosition = FormStartPosition.CenterScreen;
            var dg = frm.ShowDialog();

            if (dg.Equals(DialogResult.OK))
            {
                //MessageBox.Show(frm.strName);
                CurDWMC = buttonEditDW.Text = frm.strName;
                CurDWBH = frm.strKey;

                //切换单位关闭所有的窗体
                foreach (Form f in this.MdiChildren)
                {
                    if (f.Tag.ToString() == "main")
                    {
                        continue;
                    }

                    FormList.Remove(f.Tag.ToString());
                    f.Close();
                }

                frmLogin.setCookie("GSDWBH", CurDWBH, CurDWMC);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获得实体
        /// </summary>
        /// <returns></returns>
        private FormList EntityGet()
        {
            FormList entity = new FormList();

            entity.ID = HTDataID;
            return(entity);
        }
Exemplo n.º 6
0
        public ActionResult DeleteConfirmed(int id)
        {
            FormList formList = _formListRepository.GetWhere(x => x.Id == id).FirstOrDefault();

            _formListRepository.Delete(formList);
            return(RedirectToAction("Index"));
        }
Exemplo n.º 7
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="p_Entity">实体类</param>
        /// <returns>操作影响的记录行数</returns>
        public override int Delete(BaseEntity p_Entity)
        {
            try
            {
                FormList MasterEntity = (FormList)p_Entity;
                if (MasterEntity.ID == 0)
                {
                    return(0);
                }

                //删除主表数据
                string Sql = "";
                Sql = "DELETE FROM Enum_FormList WHERE " + "ID=" + SysString.ToDBString(MasterEntity.ID);
                //执行
                int AffectedRows = 0;
                if (!this.sqlTransFlag)
                {
                    AffectedRows = this.ExecuteNonQuery(Sql);
                }
                else
                {
                    AffectedRows = sqlTrans.ExecuteNonQuery(Sql);
                }

                return(AffectedRows);
            }
            catch (BaseException E)
            {
                throw new BaseException(E.Message, E);
            }
            catch (Exception E)
            {
                throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBDelete), E);
            }
        }
Exemplo n.º 8
0
/***********************************************************************
*                                       С Ю Ж Е Т
***********************************************************************/


        public virtual void StoryRun(int flag, FormList form)     // вызывается из формы через переопр. ф-ию
        {
            StoryMode mode = (StoryMode)flag;

// всякие проверки, потом вызываем рассказчика сюжета с подборкой эпизодов
            PrepareStory();

            if (mode == StoryMode.tutor && PrepareTutorials(form))        // прогоняем туториалку
            {
                Storyteller(mode, () => { ShowForm(form, 0); });
            }
            // это вызывается из формы ShowCounsilForm
            if (mode == StoryMode.counsil)        // нужно промотать время
            {
                PrepareCounsil();
//			Storyteller ( mode, () => { WeeklyUpdate (); main (); });
                Storyteller(mode, () => { WeeklyUpdate(); ShowPrivate(); });             // оттуда попадаем в мейн
            }
            // оттуда же
            else if (mode == StoryMode.stranger || mode == StoryMode.audience)
            {
                PrepareAudiences();
                Storyteller(mode, () => { ShowCounsil(); });
            }
            // это может быть вызвано из ShowMainForm, но не только
            else if (mode == StoryMode.events && PrepareEvents(form))
            {
                Storyteller(mode, () => { ShowForm(form, 0); });
            }
// потом всякие действия по перемотке времени - апдейт страны и т.д.
// чистим и обновляем историю
        }
Exemplo n.º 9
0
        private async Task ExecuteGetFormsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;
            GetFormsCommand.ChangeCanExecute();
            try
            {
                FormList.Clear();

                var tempList = await App.azureService.GetForms();

                foreach (var form in tempList)
                {
                    FormList.Add(form);
                }
            }
            catch (MobileServicePushFailedException ex)
            {
                await page.DisplayAlert("Uh Oh :(", "Unable to sync forms: " + ex.PushResult, "OK");
            }
            finally
            {
                IsBusy = false;
                GetFormsCommand.ChangeCanExecute();
            }
        }
Exemplo n.º 10
0
        private bool PrepareTutorials(FormList form)
        {
            bool f    = true;
            var  Ment = Strana.Government.Mentor.GetHolder();

            if (form == FormList.Main_Form)
            {
                f = SVar.sv[(int)StoryVar.Tutor0Showed];
                if (!f && Ment != null)
                {
                    PrepareTutorial(0, Ment);
                    SVar.sv[(int)StoryVar.Tutor0Showed] = true;
                }
            }
            if (form == FormList.Counsil_Form)
            {
                f = SVar.sv[(int)StoryVar.Tutor1Showed];
                if (!f && Ment != null)
                {
                    PrepareTutorial(1, Ment);
                    SVar.sv[(int)StoryVar.Tutor1Showed] = true;
                }
            }

            if (form == FormList.Trade_Form)
            {
                f = SVar.sv[(int)StoryVar.Tutor2Showed];
                var Kazn = Strana.Government.Kaznachei.GetHolder();

                if (!f && Kazn != null)
                {
                    PrepareTutorial(2, Kazn);
                    SVar.sv[(int)StoryVar.Tutor2Showed] = true;
                }
            }
            if (form == FormList.Army_Form)
            {
                f = SVar.sv[(int)StoryVar.Tutor3Showed];
                var Voed = Strana.Government.Voevoda.GetHolder();

                if (!f && Voed != null)
                {
                    PrepareTutorial(3, Voed);
                    SVar.sv[(int)StoryVar.Tutor3Showed] = true;
                }
            }
            if (form == FormList.Spy_Form)
            {
                f = SVar.sv[(int)StoryVar.Tutor4Showed];
                var Spy = Strana.Government.Spymaster.GetHolder();

                if (!f && Spy != null)
                {
                    PrepareTutorial(4, Spy);
                    SVar.sv[(int)StoryVar.Tutor4Showed] = true;
                }
            }
            return(!f);
        }
Exemplo n.º 11
0
 public ActionResult Edit([Bind(Include = "Id,Name,Surname")] FormList formList)
 {
     if (ModelState.IsValid)
     {
         return(RedirectToAction("Index"));
     }
     return(View(formList));
 }
Exemplo n.º 12
0
        private void DuplicateWindow()
        {
            Form1 form = new Form1();

            FormList.Add(form);
            UpdateForms();
            form.Show();
        }
Exemplo n.º 13
0
        /// <summary>
        /// 新增
        /// </summary>
        public override int EntityAdd()
        {
            FormListRule rule   = new FormListRule();
            FormList     entity = EntityGet();

            rule.RAdd(entity);
            return(entity.ID);
        }
Exemplo n.º 14
0
        public void AddAHearthFiresThing(SkyrimRelease release)
        {
            var xHFSxConstructionFLSTFormLink = release switch
            {
                SkyrimRelease.SkyrimLE => HearthFireStores_GS.FormList.xHFSxConstructionFLST,
                SkyrimRelease.SkyrimSE or SkyrimRelease.SkyrimVR => GeneralStores.FormList.xHFSxConstructionFLST,
                _ => throw new ArgumentException(null, nameof(release)),
            };

            var gameRelease = release switch
            {
                SkyrimRelease.SkyrimLE => GameRelease.SkyrimLE,
                SkyrimRelease.SkyrimSE => GameRelease.SkyrimSE,
                SkyrimRelease.SkyrimVR => GameRelease.SkyrimVR,
                _ => throw new ArgumentException(null, nameof(release)),
            };

            var generalStores = new SkyrimMod(xHFSxConstructionFLSTFormLink.FormKey.ModKey, release);

            var xHFSxConstructionFLST = new FormList(xHFSxConstructionFLSTFormLink.FormKey, release);

            generalStores.FormLists.Add(xHFSxConstructionFLST);

            SkyrimMod masterMod = new(masterModKey, release);

            var newThing = masterMod.MiscItems.AddNew("newItem");

            SkyrimMod patchMod = new(patchModKey, release);

            var loadOrder = new LoadOrder <IModListing <ISkyrimModGetter> >
            {
                new ModListing <ISkyrimModGetter>(generalStores, true),
                new ModListing <ISkyrimModGetter>(masterMod, true),
                new ModListing <ISkyrimModGetter>(patchMod, true)
            };

            var linkCache = loadOrder.ToImmutableLinkCache();

            Program program = new(loadOrder, linkCache, patchMod, gameRelease);

            program.hearthFiresConstructionSet.Add(newThing.AsLink());

            program.RecordClassifiedItems();

            Assert.Single(patchMod.FormLists);

            var updatedFlst = patchMod.FormLists.Single();

            Assert.Equal(xHFSxConstructionFLSTFormLink, updatedFlst.AsLink());

            Assert.Single(updatedFlst.Items);

            var newThingLink = updatedFlst.Items.Single();

            Assert.False(newThingLink.IsNull);

            Assert.Equal(newThing.AsLink(), newThingLink);
        }
Exemplo n.º 15
0
        private bool DoSelect(out string formID)
        {
            Program.ConnectToService();
            formListBindingSource.DataSource = FormList.FindAll();
            var hasSelected = ShowDialog(Program.MainForm) == DialogResult.OK;

            formID = hasSelected ? ((FormList)formListBindingSource.Current).URI : null;
            return(hasSelected);
        }
Exemplo n.º 16
0
 public FormBase()
 {
     InitializeComponent();
     if (DesignMode)
     {
         return;
     }
     FormList.Add(this);
 }
Exemplo n.º 17
0
 protected override void OnFormClosed(FormClosedEventArgs e)
 {
     base.OnFormClosed(e);
     if (FormList.Contains(this))
     {
         FormList.Remove(this);
     }
     FlushMemory();
 }
Exemplo n.º 18
0
 protected override void OnClick()
 {
     if (!FormList.Exists <GoToForm>())
     {
         GoToForm goToForm = new GoToForm();
         FormList.Add(goToForm);
         goToForm.Show();
     }
 }
Exemplo n.º 19
0
        public SafecheckController()
        {
            forms = new List <FormList>();
            FormList basic = new FormList();

            basic.Id   = 1;
            basic.Name = "Basic Form";
            forms.Add(basic);
        }
Exemplo n.º 20
0
        public static EnumContentModel GetContentModel(Element element)
        {
            if (element.tagName == "html")
            {
                return(EnumContentModel.root);
            }
            else if (element.tagName == "body")
            {
                return(EnumContentModel.body);
            }
            else if (ContentModel.MetaList.Contains(element.tagName))
            {
                return(EnumContentModel.metadata);
            }
            else if (SectionList.Contains(element.tagName))
            {
                return(EnumContentModel.section);
            }
            else if (element.tagName == "div" && (element.hasAttribute("class") || element.hasAttribute("id")))
            {
                // when a div has a class or id, it upgraded to a section element.
                return(EnumContentModel.section);
            }
            else if (GroupingList.Contains(element.tagName))
            {
                return(EnumContentModel.grouping);
            }
            else if (TextList.Contains(element.tagName))
            {
                return(EnumContentModel.text);
            }
            else if (EmbeddedList.Contains(element.tagName))
            {
                return(EnumContentModel.embedded);
            }
            else if (TableList.Contains(element.tagName))
            {
                return(EnumContentModel.table);
            }

            else if (FormList.Contains(element.tagName))
            {
                return(EnumContentModel.form);
            }
            else if (Interactive.Contains(element.tagName))
            {
                return(EnumContentModel.interactive);
            }
            else if (Edit.Contains(element.tagName))
            {
                return(EnumContentModel.edit);
            }
            else
            {
                return(EnumContentModel.unknown);
            }
        }
Exemplo n.º 21
0
 protected override void OnClick()
 {
     if (!FormList.Exists <EditExtentForm>())
     {
         EditExtentForm editExtentForm = new EditExtentForm();
         FormList.Add(editExtentForm);
         editExtentForm.Show();
     }
 }
Exemplo n.º 22
0
        public static string ApplyForm(string form_kind, int form_no, string form_package)
        {
            FormHeader formheader = FormHeaderBiz.GetFormHeader(form_kind, form_no);

            FormList formlist = FormListBiz.GetFormList(form_kind);

            SysSiteList sitelist = SysSiteListBiz.GetSiteList(formheader.SiteSerial);

            return(SimpleFlow.WebFramework.FlowerService.ApplyForm(formlist.FlowerFormKind, form_package, sitelist.FlowerFormcradle));
        }
Exemplo n.º 23
0
        public FormList GetFormListBySlno(Decimal Slno)
        {
            Hashtable lstItems = new Hashtable();
            lstItems.Add("@Slno", Slno);

            DataTable dt = dal.GetAllFormListBySlno(lstItems);
            FormList objFormList = new FormList();
            DataRow dr = dt.Rows[0];
            return GetObject(dr);
        }
Exemplo n.º 24
0
        public FormList Duplicate(
            IFormListGetter item,
            FormKey formKey,
            TranslationCrystal?copyMask)
        {
            var newRec = new FormList(formKey);

            newRec.DeepCopyIn(item, default(ErrorMaskBuilder?), copyMask);
            return(newRec);
        }
Exemplo n.º 25
0
        public static string GetFormFooterHTML(string form_kind, int form_no, string WidthType, string Width, string LogonRegion, bool IsAttachCss, bool IsShowApproveList)
        {
            FormHeader formheader = FormHeaderBiz.GetFormHeader(form_kind, form_no);

            FormList formlist = FormListBiz.GetFormList(form_kind);

            SysSiteList sitelist = SysSiteListBiz.GetSiteList(formheader.SiteSerial);

            return(SimpleFlow.WebFramework.FlowerService.GetFormFooterHTML(formlist.FlowerFormKind, formheader.FlowerFormNo, WidthType, Width, LogonRegion, IsAttachCss, IsShowApproveList, sitelist.FlowerFlowerapi));
        }
Exemplo n.º 26
0
        public ActionResult Create([Bind(Include = "Id,Name,Surname")] FormList formList)
        {
            if (ModelState.IsValid)
            {
                _formListRepository.Create(formList);
                return(RedirectToAction("Index"));
            }

            return(View(formList));
        }
Exemplo n.º 27
0
        private void mdiManager1_PageRemoved(object sender, MdiTabPageEventArgs e)
        {
            XtraMdiTabPage page = e.Page;

            if (page != null)
            {
                //if (page.MdiChild.Tag.ToString() == "main") return;
                FormList.Remove(page.MdiChild.Tag.ToString());
            }
        }
Exemplo n.º 28
0
        private void biCloseAll_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            foreach (Form f in this.MdiChildren)
            {
                //if (f.Tag.ToString() == "main") continue;

                FormList.Remove(f.Tag.ToString());
                f.Close();
            }
        }
Exemplo n.º 29
0
        public static void DeleteForm(string form_kind, int form_no, string user_id)
        {
            FormHeader formheader = FormHeaderBiz.GetFormHeader(form_kind, form_no);

            FormList formlist = FormListBiz.GetFormList(form_kind);

            SysSiteList sitelist = SysSiteListBiz.GetSiteList(formheader.SiteSerial);

            SimpleFlow.WebFramework.FlowerService.DeleteForm(formlist.FlowerFormKind, formheader.FlowerFormNo, user_id, sitelist.FlowerEngineservice);
        }
Exemplo n.º 30
0
        public static void CreateWindow(Plugin pl)
        {
            pl.Checked = true;
            PluginForm f = new PluginForm(pl);

            if (!FormList.Contains(pl))
            {
                FormList.Add(pl, f);
                f.Show();
            }
        }
Exemplo n.º 31
0
        public static void RecallForm(string form_kind, int form_no,
                                      string user_id, string reason)
        {
            FormHeader formheader = FormHeaderBiz.GetFormHeader(form_kind, form_no);

            FormList formlist = FormListBiz.GetFormList(form_kind);

            SysSiteList sitelist = SysSiteListBiz.GetSiteList(formheader.SiteSerial);

            SimpleFlow.WebFramework.FlowerService.RecallForm(formlist.FlowerFormKind, formheader.FlowerFormNo,
                                                             user_id, reason, sitelist.FlowerFlowerapi);
        }
Exemplo n.º 32
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            formList = new FormList
            {
                FormBorderStyle = FormBorderStyle.FixedToolWindow,
                MdiParent = this,
                Dock = DockStyle.Left,
                Width = 200
            };
            formList.Show();

            LayoutMdi(MdiLayout.ArrangeIcons);
        }
Exemplo n.º 33
0
        private static FormList GetObject(DataRow dr)
        {
            FormList objFormList = new FormList
            {
                 Slno = (Decimal)dr["Slno"],
                 FormName = (String)dr["FormName"],
            };

            return objFormList;
        }