コード例 #1
0
        public JsonResult Edit(SedintaPortal SedintaPortal)
        {
            response      toReturn = new response();
            string        conStr   = Session["conStr"].ToString(); //ConfigurationManager.ConnectionStrings["MySQLConnectionString"].ConnectionString;
            int           uid      = Convert.ToInt32(Session["CURENT_USER_ID"]);
            SedintaPortal sp       = new SedintaPortal(uid, conStr);

            if (SedintaPortal != null)
            {
                PropertyInfo[] pis = SedintaPortal.GetType().GetProperties();
                foreach (PropertyInfo pi in pis)
                {
                    pi.SetValue(sp, pi.GetValue(SedintaPortal));
                }
            }
            if (sp.ID == null) // insert
            {
                toReturn = sp.Insert();
            }
            else //update
            {
                toReturn = sp.Update();
            }
            return(Json(toReturn, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        //[AuthorizeUser(ActionName = "Dosare", Recursive = false)]
        public ActionResult Details(string id)
        {
            string        conStr = Session["conStr"].ToString(); //ConfigurationManager.ConnectionStrings["MySQLConnectionString"].ConnectionString;
            int           uid    = Convert.ToInt32(Session["CURENT_USER_ID"]);
            SedintaPortal sp     = new SedintaPortal(uid, conStr, Convert.ToInt32(id));

            return(PartialView("_PartialSedintePortal", sp));
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: andpsy/socisaV2
        private static void SincronizareTermenePortal()
        {
            string            conStr = CommonFunctions.StringCipher.Decrypt(ConfigurationManager.ConnectionStrings["MySqlConnectionString"].ToString(), CommonFunctions.StringCipher.RetrieveKey());
            int               id     = 1;
            ProceseRepository pr     = new ProceseRepository(id, conStr);

            Proces[] procese = (Proces[])pr.GetFiltered(null, null, " PROCESE.NR_DOSAR_INSTANTA LIKE '%/%' ", null).Result;
            List <SOCISA.Models.SedintaPortal> lst = new List <SedintaPortal>();
            QuerySoapClient ws = new QuerySoapClient();

            for (int i = 0; i < procese.Length; i++)
            {
                try
                {
                    int    id_dosar  = Convert.ToInt32(procese[i].ID_DOSAR);
                    Dosar  d         = new Dosar(id, conStr, id_dosar);
                    int    id_proces = Convert.ToInt32(procese[i].ID);
                    string nr_dosar  = procese[i].NR_DOSAR_INSTANTA;

                    socisaV2.PortalWS.Dosar dosar = ws.CautareDosare2(nr_dosar, null, null, null, null, null, null, null)[0];
                    for (int j = 0; j < dosar.sedinte.Length; j++)
                    {
                        bool gasit = false;
                        for (int k = 0; k <= 7; k++)
                        {
                            if (dosar.sedinte[j].data.Date == DateTime.Now.Date.AddDays(k).Date)
                            {
                                SedintaPortal dsp = new SedintaPortal(id, conStr);
                                dsp.ID_DOSAR = id_dosar;
                                try
                                {
                                    dsp.NR_DOSAR_CASCO = d.NR_DOSAR_CASCO;
                                }
                                catch { }
                                dsp.ID_PROCES         = id_proces;
                                dsp.NR_DOSAR_INSTANTA = procese[i].NR_DOSAR_INSTANTA;
                                dsp.DATA         = DateTime.Now.Date;
                                dsp.DATA_SEDINTA = dosar.sedinte[j].data;
                                dsp.INSTANTA     = dosar.institutie.ToString();
                                dsp.COMPLET      = dosar.sedinte[j].complet;
                                dsp.ORA          = dosar.sedinte[j].ora;
                                dsp.MONITORIZARE = true;
                                dsp.Insert();
                                gasit = true;
                                break;
                            }
                        }
                        if (gasit)
                        {
                            break;
                        }
                    }
                }
                catch (Exception exp) { exp.ToString(); }
            }
        }
コード例 #4
0
        //[AuthorizeUser(ActionName = "Dosare", Recursive = false)]
        public JsonResult ImportSedintaPortal(int IdSedintaPortal, ProcesStadiu ProcesStadiu, Sentinta Sentinta)
        {
            response r      = new response();
            string   conStr = Session["conStr"].ToString(); //ConfigurationManager.ConnectionStrings["MySQLConnectionString"].ConnectionString;
            int      uid    = Convert.ToInt32(Session["CURENT_USER_ID"]);

            if (Sentinta.NR_SENTINTA != null && Sentinta.DATA_SENTINTA != null)
            {
                Sentinta       s    = new Sentinta(uid, conStr);
                PropertyInfo[] pis1 = Sentinta.GetType().GetProperties();
                foreach (PropertyInfo pi in pis1)
                {
                    pi.SetValue(s, pi.GetValue(Sentinta));
                }
                r = s.Insert();
                if (r.Status)
                {
                    ProcesStadiu.ID_SENTINTA = r.InsertedId;
                }
            }
            ProcesStadiu ps = new ProcesStadiu(uid, conStr);

            PropertyInfo[] pis = ProcesStadiu.GetType().GetProperties();
            foreach (PropertyInfo pi in pis)
            {
                pi.SetValue(ps, pi.GetValue(ProcesStadiu));
            }
            r = ps.Insert();
            if (r.Status)
            {
                try
                {
                    SedintaPortal sp = new SedintaPortal(uid, conStr, IdSedintaPortal);
                    sp.Delete();
                }
                catch (Exception exp) { LogWriter.Log(exp); }
            }
            return(Json(r, JsonRequestBehavior.AllowGet));
        }