Example #1
0
 public FmRComInfo(string title, InitForm initForm)
 {
     InitializeComponent();
     this.panelEx1.Text = this.Text = title;
     this.initForm      = initForm;
     this.Load         += LoadData;
 }
Example #2
0
        public InitForm GetInitData(out Notification notification)
        {
            InitForm initForm = new InitForm();

            initForm.Seasons           = new List <Support.DTO.Season>();
            initForm.CostInvoice2Types = new List <DTO.CostInvoice2Type>();

            notification      = new Notification();
            notification.Type = NotificationType.Success;

            try
            {
                using (var context = CreateContext())
                {
                    initForm.CostInvoice2Types = converter.DB2DTO_CostInvoice2Types(context.CostInvoice2Mng_CostInvoice2Type_View.ToList());
                }

                Support.DAL.DataFactory supportFactory = new Support.DAL.DataFactory();
                initForm.Seasons = supportFactory.GetSeason();
            }
            catch (Exception ex)
            {
                notification.Type    = NotificationType.Error;
                notification.Message = ex.Message;

                if (ex.InnerException != null && !string.IsNullOrEmpty(ex.InnerException.Message))
                {
                    notification.DetailMessage.Add(ex.InnerException.Message);
                }
            }

            return(initForm);
        }
Example #3
0
 public static InitForm GetInitForm()
 {
     using (var db = new fz_basicEntities())
     {
         InitForm init   = new InitForm();
         sy_init  syinit = db.sy_init.FirstOrDefault();
         if (syinit != null)
         {
             init.SchoolName  = syinit.SchoolName;
             init.AuthMessage = syinit.AuthMessage;
         }
         List <dict_subject> subjectlist = db.dict_subject.Where(w => w.IsEnabled).OrderBy(o => o.Sort).ToList();
         if (subjectlist != null && subjectlist.Count > 0)
         {
             init.choEdi = new List <EdiSubGrid>();
             foreach (dict_subject subject in subjectlist)
             {
                 EdiSubGrid esg = new EdiSubGrid();
                 esg.EdiList = db.dict_edition_and_subject.Where(w => w.dict_subject.Id == subject.Id).Select(s => new Edition
                 {
                     EdiId     = s.dict_edition.Id,
                     EdiName   = s.dict_edition.Name,
                     IsEnabled = s.IsEnabled
                 }).ToList();
                 esg.SubId   = subject.Id;
                 esg.SubName = subject.Name;
                 init.choEdi.Add(esg);
             }
         }
         return(init);
     }
 }
Example #4
0
        private void onWorkflowActivated(object sender, ExternalDataEventArgs e)
        {
            XmlSerializer serializer  = new XmlSerializer(typeof(InitForm));
            XmlTextReader rdrInitForm = new XmlTextReader(new System.IO.StringReader(workflowProperties.InitiationData));
            InitForm      frmInit     = (InitForm)serializer.Deserialize(rdrInitForm);

            sTrafficCoordinator     = @"mossrtm\" + frmInit.trafficcoordinator;
            sMarketingDirectorEMail = frmInit.marketingdirectoremail;
        }
Example #5
0
        private void onWorkflowActivated(object sender, ExternalDataEventArgs e)
        {
            workflowId = workflowProperties.WorkflowId;
            XmlSerializer serializer = new XmlSerializer(typeof(InitForm));
            XmlTextReader reader     = new XmlTextReader(new StringReader(workflowProperties.InitiationData));
            InitForm      initform   = (InitForm)serializer.Deserialize(reader);

            approver     = initform.Approver;
            instructions = initform.Instructions;
        }
Example #6
0
 public static bool SaveInitForm(InitForm initform)
 {
     using (var db = new fz_basicEntities())
     {
         int tempeId;
         dict_edition_and_subject        edisub;
         List <dict_edition_and_subject> edisubList = db.dict_edition_and_subject.ToList();
         foreach (dict_edition_and_subject esub in edisubList)
         {
             esub.IsEnabled = false;
         }
         if (initform.chooseEdis1 != null)
         {
             for (int i = 0; i < initform.chooseEdis1.Length; i++)
             {
                 tempeId          = int.Parse(initform.chooseEdis1[i]);
                 edisub           = db.dict_edition_and_subject.Where(w => w.SubjectId == 1 && w.EditionId == tempeId).FirstOrDefault();
                 edisub.IsEnabled = true;
             }
         }
         if (initform.chooseEdis2 != null)
         {
             for (int i = 0; i < initform.chooseEdis2.Length; i++)
             {
                 tempeId          = int.Parse(initform.chooseEdis2[i]);
                 edisub           = db.dict_edition_and_subject.Where(w => w.SubjectId == 2 && w.EditionId == tempeId).FirstOrDefault();
                 edisub.IsEnabled = true;
             }
         }
         if (initform.chooseEdis3 != null)
         {
             for (int i = 0; i < initform.chooseEdis3.Length; i++)
             {
                 tempeId          = int.Parse(initform.chooseEdis3[i]);
                 edisub           = db.dict_edition_and_subject.Where(w => w.SubjectId == 3 && w.EditionId == tempeId).FirstOrDefault();
                 edisub.IsEnabled = true;
             }
         }
         db.sy_init.RemoveRange(db.sy_init);
         sy_init init = new sy_init();
         init.Id          = System.Guid.NewGuid().ToString();
         init.SchoolName  = initform.SchoolName;
         init.AuthMessage = initform.AuthMessage;
         db.sy_init.Add(init);
         return(db.SaveChanges() > 0);
     }
 }
Example #7
0
        public ActionResult Edit(InitForm initform)
        {
            if (ModelState.IsValid)
            {
                if(initform.File != null && !string.IsNullOrEmpty(initform.File.FileName)){
                    string path = Server.MapPath("/") + "favicon.ico";
                    initform.File.SaveAs(path);
                }
             
                bool flag = SysInitBll.SaveInitForm(initform);
                if (flag)
                {
                   return RedirectToAction("Index", "SyInit");
                }

            }
            else {
                initform = SysInitBll.GetInitForm();
            }
            return View(initform);
        }
Example #8
0
        public InitForm GetInitData(int userID, out Notification notification)
        {
            notification = new Notification()
            {
                Type = NotificationType.Success
            };

            InitForm data = new InitForm()
            {
                Data = new List <Support.DTO.Employee>()
            };

            try
            {
                Framework.DAL.DataFactory frameworkFactory = new Framework.DAL.DataFactory();
                int?companyID = frameworkFactory.GetCompanyID(userID);

                Support.DAL.DataFactory supportFactory = new Support.DAL.DataFactory();
                data.Data = supportFactory.GetEmployee();

                using (WorkCenterEntities context = CreateContext())
                {
                    data.Branches          = AutoMapper.Mapper.Map <List <WorkCenterMng_Branch_View>, List <DTO.BranchDTO> >(context.WorkCenterMng_Branch_View.Where(o => o.CompanyID == companyID).ToList());
                    data.FactoryWarehouses = AutoMapper.Mapper.Map <List <WorkCenterMng_FactoryWarehouse_View>, List <DTO.FactoryWarehouseDTO> >(context.WorkCenterMng_FactoryWarehouse_View.Where(o => o.CompanyID == companyID).ToList());
                }

                return(data);
            }
            catch (Exception ex)
            {
                notification.Type    = NotificationType.Error;
                notification.Message = ex.Message;

                return(data);
            }
        }
Example #9
0
 public ActionResult Edit()
 {
     InitForm initform = new InitForm();
     initform = SysInitBll.GetInitForm();
     return View(initform);
 }
Example #10
0
        public static void Init()
        {
            InitForm f = new InitForm();

            Autodesk.AutoCAD.ApplicationServices.Application.ShowModelessDialog(null, f, false);
        }