public static void Start() { ConfigManager.Load(); RegisterAutofac(); OAService.RegisterDataSource(); OANHibernateManager.Initial(); }
private static void BindOAMethod() { foreach (var item in CacheFlagValues) { Func <int, int, object> findList = (page, size) => { return(OAService.FindList((OAFlag)item.Value, page, size)); }; Func <object, object> add = (obj) => { if (obj is BaseEntity baseEntity) { baseEntity.CreateDate = DateTime.Now; } return(OAService.Add((OAFlag)item.Value, obj)); }; Action <object> edit = (obj) => { if (obj is BaseEntity baseEntity) { baseEntity.UpdateDate = DateTime.Now; } OAService.Save((OAFlag)item.Value, obj); }; Action <object> delete = (obj) => { OAService.Delete((OAFlag)item.Value, obj); }; var method = new MethodTemplateEntry(); method.FindList -= findList; method.Add -= add; method.Modify -= edit; method.Delete -= delete; method.FindList += findList; method.Add += add; method.Modify += edit; method.Delete += delete; CacheListModelManager.CacheFlagMethod[item.Key] = method; } }
public RouteManager() { _distanceProvider = new DistanceProvider(); _pathfinder = new PathFinder(_distanceProvider); _tlService = new TLService(); _oaService = new OAService(); _storedRoutes = new Dictionary <int, RouteInfo>(); _runningKey = 0; _orderManager = new OrderManager(); ConstructGraph(); }
protected void Page_Load(object sender, EventArgs e) { string notifyID = Request.QueryString["Notify_ID"]; OAService service = new OAService(); DataSet ds = service.Notify_Select("Subject,From_Dept,[From],convert(varchar(10),Send_Time,120) as Send_Time,[Content],Attachment_ID,Attachment_Name", "Notify_ID=" + notifyID, ""); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { lblDept.Text = ds.Tables[0].Rows[0]["From_Dept"].ToString(); lblAccount.Text = ds.Tables[0].Rows[0]["From"].ToString(); lblDate.Text = ds.Tables[0].Rows[0]["Send_Time"].ToString(); lblText.Text = ds.Tables[0].Rows[0]["Subject"].ToString(); tdContent.InnerHtml = ds.Tables[0].Rows[0]["Content"].ToString(); string strDirName = ds.Tables[0].Rows[0]["Attachment_ID"].ToString(); string strFiles = ds.Tables[0].Rows[0]["Attachment_Name"].ToString(); string[] strfile = strFiles.Split('*'); for (int i = 0; i < strfile.Length; i++) { // ../../OA/News/092/ckmsg.txt HyperLink hl = new HyperLink(); string strPath = "..\\..\\Attachment\\Notice\\" + strDirName + "\\" + strfile[i]; hl.NavigateUrl = strPath; hl.Text = strfile[i]; hl.Style.Add("cursor", "hand"); hl.Style.Add("font-Size", "14px"); hl.Target = "black"; DivAnnex.Controls.Add(hl); Label lbl = new Label(); lbl.Width = 20; DivAnnex.Controls.Add(lbl); } if (Request.QueryString["markread"] != null) { string strAccount = String.Empty; ; if (Session["Account"] != null) { strAccount = Session["Account"].ToString(); } else { HttpCookie admincookie = Request.Cookies["User_Account"]; if (admincookie != null) { strAccount = Server.UrlDecode(admincookie.Value); } } service.Notify_SetReaded(Request.QueryString["Notify_ID"], strAccount); } } else { DivDate.Style.Add("display", "none"); DivNo.Style.Add("display", ""); } //if (Request.QueryString["markread"] != null) //{ // string strAccount = String.Empty; // ; // if (Session["Account"] != null) // { // strAccount = Session["Account"].ToString(); // } // else // { // HttpCookie admincookie = Request.Cookies["User_Account"]; // if (admincookie != null) // { // strAccount = Server.UrlDecode(admincookie.Value); // } // } // service.Notify_SetReaded(Request.QueryString["Notify_ID"], strAccount); //} }