public static bool AddSignInContent(SignInContentInfo signInContentInfo) { if (UpdateContentSignInType(signInContentInfo.GeneralId, signInContentInfo.SignInType)) { Add(signInContentInfo); return(true); } return(false); }
public bool Update(SignInContentInfo signInContentInfo) { Parameters cmdParams = new Parameters(); cmdParams.AddInParameter("@GeneralId", DbType.Int32, signInContentInfo.GeneralId); cmdParams.AddInParameter("@EndTime", DbType.DateTime, signInContentInfo.EndTime); cmdParams.AddInParameter("@Priority", DbType.Int32, signInContentInfo.Priority); cmdParams.AddInParameter("@SigninType", DbType.Int32, signInContentInfo.SignInType); cmdParams.AddInParameter("@Title", DbType.String, signInContentInfo.Title); return(DBHelper.ExecuteSql("UPDATE PE_SigninContent SET Title = @Title, SigninType = @SigninType, Priority = @Priority, EndTime = @EndTime WHERE GeneralId = @GeneralId", cmdParams)); }
private static SignInContentInfo SigninContentInfoFromDataReader(NullableDataReader dr) { SignInContentInfo info = new SignInContentInfo(); info.GeneralId = dr.GetInt32("GeneralId"); info.EndTime = dr.GetDateTime("EndTime"); info.Priority = dr.GetInt32("Priority"); info.SignInType = (SignInType)dr.GetInt32("SigninType"); info.Status = (SignInStatus)dr.GetInt32("Status"); info.Title = dr.GetString("Title"); return(info); }
public bool Add(SignInContentInfo signInContentInfo) { Parameters cmdParams = new Parameters(); cmdParams.AddInParameter("@GeneralId", DbType.Int32, signInContentInfo.GeneralId); cmdParams.AddInParameter("@EndTime", DbType.DateTime, signInContentInfo.EndTime); cmdParams.AddInParameter("@Priority", DbType.Int32, signInContentInfo.Priority); cmdParams.AddInParameter("@SigninType", DbType.Int32, signInContentInfo.SignInType); cmdParams.AddInParameter("@Status", DbType.Int32, signInContentInfo.Status); cmdParams.AddInParameter("@Title", DbType.String, signInContentInfo.Title); return(DBHelper.ExecuteSql("INSERT INTO PE_SigninContent (GeneralId, EndTime, Priority, SigninType, Status, Title) VALUES (@GeneralId, @EndTime, @Priority, @SigninType, @Status, @Title)", cmdParams)); }
private void InitSignin(int generalId, bool enableSignin) { if (enableSignin) { SignInContentInfo signInContentByGeneralId = SignInContent.GetSignInContentByGeneralId(generalId); if (!signInContentByGeneralId.IsNull) { this.TxtPriority.Text = signInContentByGeneralId.Priority.ToString(); BasePage.SetSelectedIndexByValue(this.DrpSigninType, signInContentByGeneralId.SignInType.ToString()); this.DpkEndTime.Text = signInContentByGeneralId.EndTime.ToString(); } this.TxtSigninUser.Text = SignInLog.GetSignInUsers(generalId); } }
private void InitSigin(int generalId, bool enableSignin) { if (enableSignin) { SignInContentInfo signInContentByGeneralId = SignInContent.GetSignInContentByGeneralId(generalId); if (!signInContentByGeneralId.IsNull) { this.LblSigninType.Text = BaseUserControl.EnumToHtml <SignInType>(signInContentByGeneralId.SignInType); this.LblEndTime.Text = signInContentByGeneralId.EndTime.ToString(); this.LblPriority.Text = signInContentByGeneralId.Priority.ToString(); this.LblStatus.Text = BaseUserControl.EnumToHtml <SignInStatus>(signInContentByGeneralId.Status); } this.RptSigninLog.DataSource = SignInLog.GetList(generalId); this.RptSigninLog.DataBind(); } }
private void AddSignin(DataTable dataTable) { if (!string.IsNullOrEmpty(this.TxtSigninUser.Text)) { int generalId = GetGeneralId(dataTable); string str = dataTable.Select("FieldName = 'title'")[0]["FieldValue"].ToString(); SignInContentInfo signInContentInfo = new SignInContentInfo(); signInContentInfo.GeneralId = generalId; signInContentInfo.EndTime = this.DpkEndTime.Date; signInContentInfo.Priority = DataConverter.CLng(this.TxtPriority.Text); signInContentInfo.SignInType = (SignInType)Enum.Parse(typeof(SignInType), this.DrpSigninType.SelectedValue); signInContentInfo.Status = SignInStatus.NotSignIn; signInContentInfo.Title = str; SignInContent.AddSignInContent(signInContentInfo); SignInLog.Add(generalId, this.TxtSigninUser.Text); } }
private void UpdateSignin(int generalId, DataTable dataTable) { if (!string.IsNullOrEmpty(this.TxtSigninUser.Text)) { string str = dataTable.Select("FieldName = 'title'")[0]["FieldValue"].ToString(); SignInContentInfo signInContentInfo = new SignInContentInfo(); signInContentInfo.GeneralId = generalId; signInContentInfo.EndTime = this.DpkEndTime.Date; signInContentInfo.Priority = DataConverter.CLng(this.TxtPriority.Text); signInContentInfo.SignInType = (SignInType)Enum.Parse(typeof(SignInType), this.DrpSigninType.SelectedValue); signInContentInfo.Title = str; SignInContent.UpdateSignInContent(signInContentInfo); SignInContent.UpdateContentSignInType(generalId, signInContentInfo.SignInType); SignInLog.Update(generalId, this.TxtSigninUser.Text); } else { SignInContent.Delete(generalId); SignInLog.Delete(generalId); SignInContent.UpdateContentSignInType(generalId, SignInType.DisableSignIn); } }
protected void EgvContentSignin_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { CommonModelInfo dataItem = (CommonModelInfo)e.Row.DataItem; NodeInfo cacheNodeById = new NodeInfo(true); int length = 0; int nodeId = BasePage.RequestInt32("NodeID"); string nodeName = ""; if (dataItem.NodeId != nodeId) { nodeId = dataItem.NodeId; if (this.m_NodeNameDictionary.ContainsKey(dataItem.NodeId)) { nodeName = this.m_NodeNameDictionary[dataItem.NodeId]; } else { cacheNodeById = Nodes.GetCacheNodeById(dataItem.NodeId); if (!cacheNodeById.IsNull) { nodeName = cacheNodeById.NodeName; this.m_NodeNameDictionary.Add(dataItem.NodeId, nodeName); } } ExtendedHyperLink link = e.Row.FindControl("LnkNodeLink") as ExtendedHyperLink; link.BeginTag = "<strong>["; link.Text = nodeName; link.EndTag = "]</strong>"; link.NavigateUrl = "ContentHtml.aspx?NodeID=" + dataItem.NodeId.ToString() + "&NodeName=" + base.Server.UrlEncode(nodeName); length = StringHelper.SubStringLength(nodeName) + 2; } Label label = e.Row.FindControl("LblIsCreateHtml") as Label; if (!dataItem.CreateTime.HasValue || (dataItem.CreateTime.Value <= dataItem.UpdateTime)) { label.Text = "<span style=\"color:Red\"><b>\x00d7</b></span>"; } else { label.Text = "<b>√</b>"; } LinkImage image = e.Row.FindControl("LinkImageModel") as LinkImage; string itemIcon = ModelManager.GetCacheModelById(dataItem.ModelId).ItemIcon; if (string.IsNullOrEmpty(itemIcon)) { itemIcon = "Default.gif"; } image.Icon = itemIcon; if (dataItem.LinkType != 0) { image.IsShowLink = true; } Label label2 = e.Row.FindControl("lblSigninStatus") as Label; SignInContentInfo signInContentByGeneralId = SignInContent.GetSignInContentByGeneralId(dataItem.GeneralId); string signInUsers = SignInLog.GetSignInUsers(dataItem.GeneralId); IList <SignInLogInfo> list = SignInLog.GetList(dataItem.GeneralId); StringBuilder sb = new StringBuilder(); StringBuilder builder2 = new StringBuilder(); foreach (SignInLogInfo info4 in list) { if (info4.IsSignIn) { StringHelper.AppendString(sb, info4.UserName); } else { StringHelper.AppendString(builder2, info4.UserName); } } string str4 = ""; if (!signInContentByGeneralId.IsNull) { str4 = "<font color=" + ((signInContentByGeneralId.Status == SignInStatus.NotSignIn) ? "red" : "green") + ">[" + BasePage.EnumToHtml <SignInStatus>(signInContentByGeneralId.Status) + "]</font>"; label2.Text = "<a href='' onclick='return false' title='要求签收用户:" + signInUsers + " 已经签收用户:" + sb.ToString() + " 尚未签收用户:" + builder2.ToString() + "'>" + str4 + "</a>"; } HyperLink link2 = e.Row.FindControl("HypTitle") as HyperLink; length = 0x25 - length; link2.Text = StringHelper.SubString(dataItem.Title, length, "..."); link2.ToolTip = dataItem.Title; link2.NavigateUrl = "ContentView.aspx?GeneralID=" + dataItem.GeneralId.ToString(); HyperLink link3 = (HyperLink)e.Row.FindControl("EahContentModify"); link3.NavigateUrl = "Content.aspx?Action=Modify&GeneralID=" + dataItem.GeneralId.ToString() + "&NodeID=" + dataItem.NodeId.ToString(); if (!this.m_Administrator) { string checkStr = nodeId.ToString(); if (cacheNodeById.IsNull) { cacheNodeById = Nodes.GetCacheNodeById(nodeId); } if (cacheNodeById.ParentId > 0) { checkStr = checkStr + "," + cacheNodeById.ParentPath; } if (!StringHelper.FoundCharInArr(checkStr, this.m_arrContentNodeIdManage)) { ((HyperLink)e.Row.FindControl("EahContentModify")).Enabled = false; ((LinkButton)e.Row.FindControl("ELbtnDelete")).Enabled = false; } } } }
public static bool UpdateSignInContent(SignInContentInfo signInContentInfo) { return(dal.Update(signInContentInfo) || Add(signInContentInfo)); }
public static bool Add(SignInContentInfo signInContentInfo) { return(dal.Add(signInContentInfo)); }