Exemplo n.º 1
0
 public void CreateCateNewsGroup(CateNewsGroup cateNewsGroup)
 {
     using (SqlConnection connection = base.GetConnection())
     {
         SqlCommand command = new SqlCommand("_CateNewsGroupUpdate", connection) {
             CommandType = CommandType.StoredProcedure
         };
         command.Parameters.AddWithValue("@Type", 0);
         command.Parameters.AddWithValue("@CateNewsGroupID", 0);
         command.Parameters.AddWithValue("@GroupCate", cateNewsGroup.GroupCate);
         command.Parameters.AddWithValue("@CateNewsGroupName", cateNewsGroup.CateNewsGroupName);
         command.Parameters.AddWithValue("@Description", cateNewsGroup.Description);
         command.Parameters.AddWithValue("@Order", cateNewsGroup.Order);
         command.Parameters.AddWithValue("@IsView", cateNewsGroup.IsView);
         command.Parameters.AddWithValue("@IsHome", cateNewsGroup.IsHome);
         command.Parameters.AddWithValue("@IsMenu", cateNewsGroup.IsMenu);
         command.Parameters.AddWithValue("@IsNew", cateNewsGroup.IsNew);
         command.Parameters.AddWithValue("@IsPage", cateNewsGroup.IsPage);
         command.Parameters.AddWithValue("@IsUrl", cateNewsGroup.IsUrl);
         command.Parameters.AddWithValue("@Url", cateNewsGroup.Url);
         command.Parameters.AddWithValue("@Icon", cateNewsGroup.Icon);
         command.Parameters.AddWithValue("@Position", cateNewsGroup.Position);
         command.Parameters.AddWithValue("@language", cateNewsGroup.Language);
         connection.Open();
         if (command.ExecuteNonQuery() <= 0)
         {
             throw new DataAccessException("Khong them duoc");
         }
         command.Dispose();
     }
 }
Exemplo n.º 2
0
 public void UpdateCateNewsGroup(CateNewsGroup cateNewsGroup)
 {
     new CateNewsGroupDAO().UpdateCateNewsGroup(cateNewsGroup);
 }
Exemplo n.º 3
0
 public void CreateCateNewsGroup(CateNewsGroup cateNewsGroup)
 {
     new CateNewsGroupDAO().CreateCateNewsGroup(cateNewsGroup);
 }
        private CateNewsGroup ReceiveHtml()
        {

            string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "Upload/Category/Group/";
            commonBSO commonBSO = new commonBSO();
            string image_icon = commonBSO.UploadImage(icon, path, 55, 55);

            CateNewsGroup catenewsGroup = new CateNewsGroup();
            catenewsGroup.CateNewsGroupID = (hddCateNewsGroupID.Value != "") ? Convert.ToInt32(hddCateNewsGroupID.Value) : 0;
            catenewsGroup.CateNewsGroupName = txtCateNewsGroupName.Text;
            catenewsGroup.GroupCate = (txtGroupCate.Text != "") ? Convert.ToInt32(txtGroupCate.Text) : 0;
            catenewsGroup.Order = (hddOrder.Value != "") ? Convert.ToInt32(hddOrder.Value) : 0;
            catenewsGroup.Description = txtDescription.Text;
            catenewsGroup.IsView = chkView.Checked;
            catenewsGroup.IsHome = chkHome.Checked;
            catenewsGroup.IsMenu = chkMenu.Checked;
            catenewsGroup.IsNew = chkNews.Checked;
            catenewsGroup.IsPage = chkPage.Checked;
            catenewsGroup.Language = NgonNgu.SelectedValue;
            catenewsGroup.Icon = (image_icon != "") ? image_icon : hddIcon.Value;
            catenewsGroup.IsUrl = Convert.ToBoolean(rdbUrl.SelectedValue);
            catenewsGroup.Url = txtUrl.Text;

            catenewsGroup.Position = (txtPosition.Text != "") ? Convert.ToInt32(txtPosition.Text) : 0;

            return catenewsGroup;
        }