public void Insert(M_PowerGroup model) { SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@PowerName", SqlDbType.NVarChar, 50), new SqlParameter("@PowerColumn", SqlDbType.NText), new SqlParameter("@PowerChannel", SqlDbType.NText), new SqlParameter("@PowerAuditing", SqlDbType.NText), new SqlParameter("@PowerModel", SqlDbType.NVarChar, 50), new SqlParameter("@AddDate", SqlDbType.DateTime), new SqlParameter("@TypeId", SqlDbType.Int), new SqlParameter("@PowerContent", SqlDbType.NText) }; commandParameters[0].Value = model.PowerName; commandParameters[1].Value = model.PowerColumn; commandParameters[2].Value = model.PowerChannel; commandParameters[3].Value = model.PowerAuditing; commandParameters[4].Value = model.PowerModel; commandParameters[5].Value = model.AddDate; commandParameters[6].Value = model.TypeId; commandParameters[7].Value = model.PowerContent; SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_PowerGroup", commandParameters); }
public M_PowerGroup Show(int PowerId) { SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@TypeId", SqlDbType.Int), new SqlParameter("@PowerId", SqlDbType.Int) }; commandParameters[0].Value = 2; commandParameters[1].Value = PowerId; DataTable table = new DataTable(); table = SqlHelper.ExecuteTable(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_PowerGroup", commandParameters); if (table.Rows.Count > 0) { M_PowerGroup group = new M_PowerGroup(); group.PowerName = table.Rows[0]["PowerName"].ToString(); group.PowerColumn = table.Rows[0]["PowerColumn"].ToString(); group.PowerChannel = table.Rows[0]["PowerChannel"].ToString(); group.PowerAuditing = table.Rows[0]["PowerAuditing"].ToString(); group.PowerModel = table.Rows[0]["PowerModel"].ToString(); group.PowerContent = table.Rows[0]["PowerContent"].ToString(); return group; } return null; }
public bool Power_Channel(int ChId, int ColId, int PowerId, int TypeId) { if (PowerId == 1) { return true; } M_PowerGroup group = new M_PowerGroup(); group = this.ipg.Show(PowerId); string[] strArray4 = group.PowerChannel.Split(new char[] { ',' }); for (int i = 0; i < strArray4.Length; i++) { string[] strArray = strArray4[i].Split(new char[] { '=' }); string[] strArray2 = strArray[0].Split(new char[] { '@' }); if (((strArray2[0] == ("" + ChId + "")) && (strArray2[1] == ("" + ColId + ""))) && (strArray[1].Split(new char[] { '|' })[TypeId - 1] == "1")) { return true; } } return false; }
public string Power_Auditing(int ChId, int PowerId) { if (PowerId == 1) { return "3"; } M_PowerGroup group = new M_PowerGroup(); group = this.ipg.Show(PowerId); string str = "0"; string[] strArray = group.PowerAuditing.Split(new char[] { ',' }); for (int i = 0; i < strArray.Length; i++) { string[] strArray2 = strArray[i].Split(new char[] { '=' }); if (strArray2[0] == ("" + ChId + "")) { str = strArray2[1].ToString(); } } return str; }
/// <summary> /// /// </summary> private void ShowPowerColumn() { string PowerId = Request.QueryString["PowerId"]; Mpowergroup = Bpowergroup.Show(int.Parse(PowerId)); PowerName.Text = Mpowergroup.PowerName; PowerContent.Text = Mpowergroup.PowerContent; #region 返选栏目 DataTable dt1 = new DataTable(); dt1 = Bpowergroup.PowerColumnNameList(); for (int i = 0;i < dt1.Rows.Count; i++) { string MyPcId = "PCId_" + dt1.Rows[i]["PCId"].ToString() + ""; CheckBox MyPcId1 = (CheckBox)FindControl(MyPcId); if (Bpowergroup.Power_Column(int.Parse(dt1.Rows[i]["PCId"].ToString()), int.Parse(PowerId))) { MyPcId1.Checked = true; } } dt1.Clear(); dt1.Dispose(); #endregion }
protected void Page_Load(object sender, EventArgs e) { AdminBll.CheckMulitLogin(); LoginAdminModel = AdminBll.GetLoginModel(); AdminModel = AdminBll.GetModel(LoginAdminModel.UserId); litUserName.Text = AdminModel.UserName; AdminGroupModel = AdminGroupBll.Show(AdminModel.GroupId); litGroupName.Text = AdminGroupModel.PowerName; lbNotice.Visible = true; lbNotice.Text = "<script language=\"javascript\" src=\"http://info.kycms.com/notice_info.js\"></script>"; string dateStr = DateTime.Today.ToString("yyyy年MM月dd日"); int weekNumber = (int)DateTime.Today.DayOfWeek; string weekStr = string.Empty; switch (weekNumber) { default: case 0: weekStr = "星期日"; break; case 1: weekStr = "星期一"; break; case 2: weekStr = "星期二"; break; case 3: weekStr = "星期三"; break; case 4: weekStr = "星期四"; break; case 5: weekStr = "星期五"; break; case 6: weekStr = "星期六"; break; } litDate.Text = dateStr + " " + weekStr; StringBuilder sb = new StringBuilder(); sb.Append("共有会员: "); sb.Append(UserBll.GetUserCount(0, 0)); sb.Append("人 "); DataTable userGroupModelDt = UserGroupModelBll.GetAll(); for (int i = 0; i < userGroupModelDt.Rows.Count; i++) { DataRow dr = userGroupModelDt.Rows[i]; int typeId = int.Parse(dr["id"].ToString()); string name = "[" + dr["name"].ToString() + "]"; sb.Append(name); sb.Append(":"); int count = UserBll.GetUserCount(typeId, 0); sb.Append(count); if (i == userGroupModelDt.Rows.Count - 1) { sb.Append("人 "); } else { sb.Append("人 "); } } LitCount.Text = sb.ToString(); //DataTable dt = InfoModelBll.GetList(); //InfoModelDt = new DataTable(); //InfoModelDt.Columns.Add("name", typeof(string)); //InfoModelDt.Columns.Add("total", typeof(string)); //InfoModelDt.Columns.Add("nocheck", typeof(string)); //for (int i = 0; i < dt.Rows.Count; i++) //{ // DataRow dr = dt.Rows[i]; // string name = dr["modelname"].ToString(); // string tableName = dr["tablename"].ToString(); // int totalCount = InfoModelBll.GetModelInfoCount(tableName, "[status] in(0,1,2,3)"); // int noCheckCount = InfoModelBll.GetModelInfoCount(tableName,"[status] in(0,1,2)"); // DataRow infoModelDr = InfoModelDt.NewRow(); // infoModelDr["name"] = name; // infoModelDr["total"] = totalCount; // infoModelDr["nocheck"] = noCheckCount; // InfoModelDt.Rows.Add(infoModelDr); //} //repCount.DataSource = InfoModelDt.DefaultView; //repCount.DataBind(); //InfoModelDt.Dispose(); }
public bool Power_Column(int ChId, int PowerId) { if (PowerId == 1) { return true; } M_PowerGroup group = new M_PowerGroup(); group = this.ipg.Show(PowerId); string[] strArray = group.PowerColumn.Split(new char[] { ',' }); for (int i = 0; i < strArray.Length; i++) { string[] strArray2 = strArray[i].Split(new char[] { '=' }); if ((strArray2[0] == ("" + ChId + "")) && (strArray2[1] == "1")) { return true; } } return false; }
public void Insert(M_PowerGroup model) { this.ipg.Insert(model); }
public void Update(M_PowerGroup model) { this.ipg.Update(model); }