예제 #1
0
 public void Show()
 {
     EnterpriseModel = EnterpriseBll.GetEnterpriseById(Id, UserModel.UserID);
     txtTitle.Text = EnterpriseModel.Title;
     ddlTypeId.SelectedValue = EnterpriseModel.TypeId.ToString();
     txtContent.Text = EnterpriseModel.Conetent;
 }
예제 #2
0
 public void AddEnterPrise(M_Enterprise model)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@Id", SqlDbType.Int, 4), new SqlParameter("@UserId", SqlDbType.Int, 4), new SqlParameter("@Title", SqlDbType.NVarChar), new SqlParameter("@Conetent", SqlDbType.Text), new SqlParameter("@AddTime", SqlDbType.NVarChar), new SqlParameter("@TypeId", SqlDbType.Int, 4) };
     commandParameters[0].Value = model.Id;
     commandParameters[1].Value = model.UserId;
     commandParameters[2].Value = model.Title;
     commandParameters[3].Value = model.Conetent;
     commandParameters[4].Value = model.AddTime;
     commandParameters[5].Value = model.TypeId;
     SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_EnterPrise_Set", commandParameters);
 }
예제 #3
0
 public M_Enterprise GetEnterpriseById(int Id, int userId)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@Id", Id), new SqlParameter("@UserId", userId) };
     DataTable table = SqlHelper.ExecuteTable(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_Enterprise_GetById", commandParameters);
     M_Enterprise enterprise = new M_Enterprise();
     if (table.Rows.Count > 0)
     {
         enterprise.Id = Id;
         enterprise.UserId = int.Parse(table.Rows[0]["UserId"].ToString());
         enterprise.TypeId = int.Parse(table.Rows[0]["TypeId"].ToString());
         enterprise.Title = table.Rows[0]["Title"].ToString();
         enterprise.Conetent = table.Rows[0]["Conetent"].ToString();
         enterprise.AddTime = table.Rows[0]["AddTime"].ToString();
         return enterprise;
     }
     return null;
 }
예제 #4
0
 public void UpdateEnterPrise(M_Enterprise model)
 {
     this.IE.UpdateEnterPrise(model);
 }
예제 #5
0
 public void AddEnterPrise(M_Enterprise model)
 {
     this.IE.AddEnterPrise(model);
 }