Ejemplo n.º 1
0
 public IntrospectedTrigger(string schema, string name, IntrospectedTable table, TriggerTiming timing, TriggerEvents events, string body)
     : base(schema, name)
 {
     this.table  = table;
     this.timing = timing;
     this.events = events;
     this.body   = body;
 }
Ejemplo n.º 2
0
        internal static string ToSql(this TriggerTiming timing)
        {
            switch (timing)
            {
            case TriggerTiming.After: return("AFTER");

            case TriggerTiming.Before: return("BEFORE");

            case TriggerTiming.InsteadOf: return("INSTEAD OF");

            default: throw new ArgumentException("Invalid trigger timing");
            }
        }
Ejemplo n.º 3
0
        //zxh

        public string ListMission_zxh()
        {
            try
            {
                IObjectContextAdapter IOca = new EquipWebContext();

                List <UI_MISSION> miss = CWFEngine.GetActiveMissions <Person_Info>(IOca.ObjectContext);


                List <Object> miss_obj = new List <object>();
                string        userName = (Session["User"] as EquipModel.Entities.Person_Info).Person_Name.ToString();
                foreach (UI_MISSION item in miss)
                {
                    MainMissionsModel mm = GetMainMissionsInfo(item.WE_Entity_Id);


                    Jobs   js      = new Jobs();
                    string endtime = "";
                    string lsh_xy  = "1";


                    if (js.GetDSnexttime(mm.jobname, item.WE_Entity_Id) != null)
                    {
                        if (js.GetDSnexttime(mm.jobname, item.WE_Entity_Id).PreTime == null)
                        {
                            string        end_corn = js.GetDSnexttime(mm.jobname, item.WE_Entity_Id).corn_express;
                            TriggerTiming TT       = new TriggerTiming();
                            TT.FromString(end_corn);
                            TT.RefreshNextTiming(DateTime.Now);
                            endtime = TT.NextTiming.ToString();
                        }
                        else
                        {
                            endtime = js.GetDSnexttime(mm.jobname, item.WE_Entity_Id).PreTime.ToString();
                        }
                    }


                    if (mm.Equip_GyCode == null || mm.Equip_GyCode == "")
                    {
                        lsh_xy = "0";
                    }
                    object o = new
                    {
                        WF_ICON    = "fa fa-flash text-text-aqua",
                        MISS_Url   = item.Mission_Url,
                        WF_Name    = mm.WF_Name,
                        MISS_Name  = item.WE_Event_Desc,
                        wfe_serial = mm.wfe_serial,
                        sbCode     = mm.Equip_GyCode,
                        time       = mm.time,
                        endtime    = endtime,
                        lsh_xy     = lsh_xy
                    };
                    EquipManagment em = new EquipManagment();
                    if (mm.WF_Name.Contains("定时KPI月报"))
                    {
                        if (userName == "龚海桥" && mm.WF_Name.Contains("联合一片区"))
                        {
                            miss_obj.Add(o);
                        }
                        else if (userName == "丁一刚" && mm.WF_Name.Contains("联合二片区"))
                        {
                            miss_obj.Add(o);
                        }
                        else if (userName == "邓杰" && (mm.WF_Name.Contains("联合三片区") || mm.WF_Name.Contains("化工片区")))
                        {
                            miss_obj.Add(o);
                        }
                        else if (userName == "杨书毅" && mm.WF_Name.Contains("联合四片区"))
                        {
                            miss_obj.Add(o);
                        }
                        else if (userName == "武文斌" && (mm.WF_Name.Contains("综合片区") || mm.WF_Name.Contains("系统片区")))
                        {
                            miss_obj.Add(o);
                        }
                    }
                    else
                    {
                        if (userName == "sa" || userName == "程聂")
                        {
                            miss_obj.Add(o);
                        }
                        else
                        {
                            if (lsh_xy == "1")
                            {
                                if (em.getEquip_ByGyCode(mm.Equip_GyCode).Equip_Specialty == "动")
                                {
                                    miss_obj.Add(o);
                                }
                            }
                            else
                            {
                                miss_obj.Add(o);
                            }
                        }
                    }
                }

                TablesManagment tm     = new TablesManagment();
                int             UserId = (Session["User"] as EquipModel.Entities.Person_Info).Person_Id;
                PersonManagment pm     = new PersonManagment();
                EquipBLL.AdminManagment.PersonManagment.P_viewModal pv = pm.Get_PersonModal(UserId);
                if (pv.Role_Names.Contains("可靠性工程师"))
                {
                    string             wfe_ser = "";
                    List <string>      cjname  = new List <string>();
                    List <Equip_Archi> EA      = pm.Get_Person_Cj(UserId);
                    foreach (var ea in EA)
                    {
                        cjname.Add(ea.EA_Name);
                    }
                    List <A5dot1Tab1> E = tm.Getdcl_listbyisZG(0, cjname);

                    for (int i = 0; i < E.Count; i++)
                    {
                        if (E[i].dataSource != null)
                        {
                            wfe_ser = E[i].dataSource;
                        }
                        object o = new
                        {
                            WF_ICON    = "fa fa-flash text-text-aqua",
                            MISS_Url   = "/A5dot1/Index",
                            WF_Name    = "设备完好",
                            MISS_Name  = "可靠性工程师确认整改",
                            wfe_serial = wfe_ser,
                            sbCode     = E[i].sbGyCode.ToString(),
                            time       = E[i].zzSubmitTime.ToString(),
                            endtime    = "",
                            lsh_xy     = 1
                        };
                        miss_obj.Add(o);
                    }
                    SxglManagment     Sx = new SxglManagment();
                    List <A5dot2Tab1> EE = Sx.GetSxItem(cjname);
                    foreach (var item in EE)
                    {
                        if (item.temp2 != null)
                        {
                            wfe_ser = item.temp2;
                        }
                        object o = new
                        {
                            WF_ICON    = "fa fa-flash text-text-aqua",
                            MISS_Url   = "/A5dot2/Index",
                            WF_Name    = "竖向问题",
                            MISS_Name  = "可靠性工程师确认整改",
                            wfe_serial = wfe_ser,
                            sbCode     = item.sbGyCode.ToString(),
                            time       = item.jxSubmitTime.ToString(),
                            endtime    = "",
                            lsh_xy     = 1
                        };
                        miss_obj.Add(o);
                    }
                }

                string str = JsonConvert.SerializeObject(miss_obj);
                return("{" + "\"data\": " + str + "}");
            }
            catch (Exception e)
            {
                return(null);
            }
        }
Ejemplo n.º 4
0
    public void Unsubscribe(OnBeatDelegate subscriber, TriggerTiming triggerTiming, bool advanced = false)
    {
        if (advanced)
        {
            switch (triggerTiming)
            {
            case TriggerTiming.Thirtyseconds:
            {
                OnAdvanced32nd -= subscriber;
                return;
            }

            case TriggerTiming.Sixteenths:
            {
                OnAdvanced16th -= subscriber;
                return;
            }

            case TriggerTiming.Eighths:
            {
                OnAdvanced8th -= subscriber;
                return;
            }

            case TriggerTiming.Quarters:
            {
                OnAdvancedQuarter -= subscriber;
                return;
            }

            case TriggerTiming.Halves:
            {
                OnAdvancedHalf -= subscriber;
                return;
            }

            case TriggerTiming.Wholes:
            {
                OnAdvancedWhole -= subscriber;
                return;
            }
            }
        }
        else
        {
            switch (triggerTiming)
            {
            case TriggerTiming.Thirtyseconds:
            {
                On32nd -= subscriber;
                return;
            }

            case TriggerTiming.Sixteenths:
            {
                On16th -= subscriber;
                return;
            }

            case TriggerTiming.Eighths:
            {
                On8th -= subscriber;
                return;
            }

            case TriggerTiming.Quarters:
            {
                OnQuarter -= subscriber;
                return;
            }

            case TriggerTiming.Halves:
            {
                OnHalf -= subscriber;
                return;
            }

            case TriggerTiming.Wholes:
            {
                OnWhole -= subscriber;
                return;
            }
            }
        }
    }
Ejemplo n.º 5
0
 public static SubObjectState <TriggerType, State> Create(Identifier table, string name, TriggerTiming timing, TriggerEvents events, string body)
 {
     return(CreateState(table, name, new State(timing, events, body)));
 }
Ejemplo n.º 6
0
 internal State(TriggerTiming timing, TriggerEvents events, string body)
 {
     this.timing = timing;
     this.events = events;
     this.body   = body;
 }
Ejemplo n.º 7
0
 // Add trigger
 public override string GetCreateTriggerSql(string tableName, string triggerName, TriggerTiming timing, TriggerEvents events, string body)
 {
     return("CREATE OR REPLACE TRIGGER " + QuoteSchemaIdentifier(triggerName) + "\n"
            + "  " + timing.ToSql() + " " + events.ToSql() + " ON " + QuoteSchemaIdentifier(tableName) + " FOR EACH ROW\n"
            + "  BEGIN\n" + body + "  END;");
 }
Ejemplo n.º 8
0
 // Add Trigger
 public virtual string GetCreateTriggerSql(string tableName, string triggerName, TriggerTiming timing, TriggerEvents events, string body)
 {
     return("CREATE TRIGGER " + QuoteSchemaIdentifier(triggerName) + " ON " + QuoteSchemaIdentifier(tableName) + " " + timing.ToSql() + " " +
            events.ToSql() + " AS BEGIN\r\n" + body + "\r\nEND;\r\n");
 }