public int CreateModulesFrontPanel(ModulesFrontPanel modulesFrontPanel)
 {
     using (SqlConnection connection = base.GetConnection())
     {
         SqlCommand command = new SqlCommand("_ModulesFrontPanelUpdate", connection)
         {
             CommandType = CommandType.StoredProcedure
         };
         command.Parameters.AddWithValue("@Type", 0);
         command.Parameters.AddWithValue("@ModulesFrontPanel_ID", 1);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Name", modulesFrontPanel.ModulesFrontPanelName);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Parent", modulesFrontPanel.ModulesFrontPanelParent);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Url", modulesFrontPanel.ModulesFrontPanelUrl);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Order", modulesFrontPanel.ModulesFrontPanelOrder);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Help", modulesFrontPanel.ModulesFrontPanelHelp);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Icon", modulesFrontPanel.ModulesFrontPanelIcon);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Title", modulesFrontPanel.ModulesFrontPanelTitle);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Value", modulesFrontPanel.ModulesFrontPanelValue);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Record", modulesFrontPanel.ModulesFrontPanelRecord);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Status", modulesFrontPanel.ModulesFrontPanelStatus);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Panel", modulesFrontPanel.ModulesFrontPanelPanel);
         command.Parameters.AddWithValue("@ModulesFontPanel_Content", modulesFrontPanel.ModulesFontPanelContent);
         command.Parameters.AddWithValue("@language", modulesFrontPanel.Language);
         connection.Open();
         return command.ExecuteNonQuery();
     }
 }
 public int UpdateModulesFrontPanel(ModulesFrontPanel modulesFrontPanel)
 {
     using (SqlConnection connection = base.GetConnection())
     {
         SqlCommand command = new SqlCommand("_ModulesFrontPanelUpdate", connection)
         {
             CommandType = CommandType.StoredProcedure
         };
         command.Parameters.AddWithValue("@Type", 1);
         command.Parameters.AddWithValue("@ModulesFrontPanel_ID", modulesFrontPanel.ModulesFrontPanelID);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Name", modulesFrontPanel.ModulesFrontPanelName);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Parent", modulesFrontPanel.ModulesFrontPanelParent);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Url", modulesFrontPanel.ModulesFrontPanelUrl);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Order", modulesFrontPanel.ModulesFrontPanelOrder);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Help", modulesFrontPanel.ModulesFrontPanelHelp);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Icon", modulesFrontPanel.ModulesFrontPanelIcon);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Title", modulesFrontPanel.ModulesFrontPanelTitle);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Value", modulesFrontPanel.ModulesFrontPanelValue);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Record", modulesFrontPanel.ModulesFrontPanelRecord);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Status", modulesFrontPanel.ModulesFrontPanelStatus);
         command.Parameters.AddWithValue("@ModulesFrontPanel_Panel", modulesFrontPanel.ModulesFrontPanelPanel);
         command.Parameters.AddWithValue("@ModulesFontPanel_Content", modulesFrontPanel.ModulesFontPanelContent);
         command.Parameters.AddWithValue("@language", modulesFrontPanel.Language);
         connection.Open();
         int i = command.ExecuteNonQuery();
         if (i <= 0)
         {
             throw new DataAccessException("lỗi kh\x00f4ng thể cập nhật");
         }
         return i;
     }
 }
 public int AddModulesFrontPanel(ModulesFrontPanel _modulesFrontPanel)
 {
     ModulesFrontPanelDAO modulesFrontPanelDAO = new ModulesFrontPanelDAO();
     return modulesFrontPanelDAO.CreateModulesFrontPanel(_modulesFrontPanel);
 }
        public ModulesFrontPanel ReceiveHtml()
        {
            ModulesFrontPanel _modulesFrontPanel = new ModulesFrontPanel();

            //      string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Admin/Admin_Theme/Icons/";
            string path = Request.PhysicalApplicationPath.Replace(@"\", "/") + "/Upload/Admin_Theme/Icons/";
            commonBSO commonBSO = new commonBSO();
            string icon_upload = commonBSO.UploadImage(uploadIcon, path, 32, 32);

            _modulesFrontPanel.ModulesFrontPanelID = (txtModulesFrontPanelID.Value != "") ? Convert.ToInt32(txtModulesFrontPanelID.Value) : 0;
            _modulesFrontPanel.ModulesFrontPanelName = (txtModulesFrontPanelName.Text != "") ? txtModulesFrontPanelName.Text.Trim() : "";
            _modulesFrontPanel.ModulesFrontPanelOrder = 0;
            _modulesFrontPanel.ModulesFrontPanelParent = (ddlModulesFrontPanel.SelectedValue != "") ? Convert.ToInt32(ddlModulesFrontPanel.SelectedValue) : 0;
            //_modulesFrontPanel.ModulesFrontPanelUrl = (txtModulesFrontPanelUrl.Text != "") ? txtModulesFrontPanelUrl.Text.Trim() : "";
            if (dropControl.SelectedIndex > 0)
            {
                _modulesFrontPanel.ModulesFrontPanelUrl = dropControl.SelectedValue;
            }

            _modulesFrontPanel.ModulesFrontPanelHelp = txtRadHelp.Content;
            _modulesFrontPanel.ModulesFontPanelContent = txtRadFull.Content;
            _modulesFrontPanel.ModulesFrontPanelIcon = (icon_upload != "") ? icon_upload : hddIcon.Value;

            _modulesFrontPanel.ModulesFrontPanelTitle = (txtModulesFrontPanelTitle.Text != "") ? txtModulesFrontPanelTitle.Text.Trim() : "";
            _modulesFrontPanel.ModulesFrontPanelValue = (ddlValueCategory.SelectedValue != "") ? ddlValueCategory.SelectedValue.Trim() : "0";
            _modulesFrontPanel.ModulesFrontPanelRecord = (txtRecord.Text != "") ? Convert.ToInt32(txtRecord.Text) : 5;
            _modulesFrontPanel.ModulesFrontPanelPanel = rdbPanel.SelectedValue;
            _modulesFrontPanel.ModulesFrontPanelStatus = chkStatus.Checked;
            _modulesFrontPanel.Language = NgonNgu.SelectedValue;

            return _modulesFrontPanel;
        }
 public int EditModulesFrontPanel(ModulesFrontPanel _modulesFrontPanel)
 {
     ModulesFrontPanelDAO modulesFrontPanelDAO = new ModulesFrontPanelDAO();
     return modulesFrontPanelDAO.UpdateModulesFrontPanel(_modulesFrontPanel);
 }