Ejemplo n.º 1
0
 private HPCInfo.T_Album_Categories PopulateItem(int _id)
 {
     HPCInfo.T_Album_Categories _cateObj = new HPCInfo.T_Album_Categories();
     HPCBusinessLogic.DAL.T_Album_CategoriesDAL _cateDAL = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL();
     _cateObj = _cateDAL.load_T_Album_Categories(_id);
     return(_cateObj);
 }
Ejemplo n.º 2
0
 private void PopulateItem(int _id)
 {
     HPCInfo.T_Album_Categories _cateObj = new HPCInfo.T_Album_Categories();
     HPCBusinessLogic.DAL.T_Album_CategoriesDAL _cateDAL = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL();
     _cateObj = _cateDAL.load_T_Album_Categories(_id);
     if (_cateObj != null)
     {
         Txt_tieudeAbum.Text             = _cateObj.Cat_Album_Name.ToString();
         txt_noidungAlbum.Text           = _cateObj.Cat_AlbumDesc.ToString();
         txtOrder.Text                   = _cateObj.Possition.ToString();
         lbl_status.Text                 = _cateObj.Cat_Album_Status_Approve.ToString();
         this.cbo_lanquage.SelectedValue = _cateObj.Lang_ID.ToString();
         this.cbo_chuyenmuc.Items.Clear();
         if (cbo_lanquage.SelectedIndex > 0)
         {
             UltilFunc.BindCombox(cbo_chuyenmuc, "Ma_ChuyenMuc", "Ten_ChuyenMuc", "T_ChuyenMuc", string.Format(" HoatDong = 1 and HienThi_BDT = 1 and Ma_AnPham= " + this.cbo_lanquage.SelectedValue + " AND Ma_ChuyenMuc IN ({0})", UltilFunc.GetCategory4User(_user.UserID)), CommonLib.ReadXML("lblTatca"), "Ma_Chuyenmuc_Cha", " Order by ThuTuHienThi ASC");
             cbo_chuyenmuc.UpdateAfterCallBack = true;
             cbo_chuyenmuc.SelectedIndex       = CommonLib.GetIndexControl(cbo_chuyenmuc, _cateObj.Cat_Album_CATID.ToString());
         }
         else
         {
             this.cbo_chuyenmuc.DataSource = null;
             this.cbo_chuyenmuc.DataBind();
             this.cbo_chuyenmuc.UpdateAfterCallBack = true;
         }
         //ddlnews_chatluong.SelectedIndex = _cateObj.Chatluong;
         txt_Author_name.Text = _cateObj.Tacgia;
         if (_cateObj.TongtienTT > 0)
         {
             if (_cateObj.TongtienTT > 0)
             {
                 this.txt_tiennhanbut.Text = string.Format("{0:#,#}", _cateObj.TongtienTT).Replace(".", ",");
             }
         }
         this.txtGhichu.Text = _cateObj.Comment;
         HPCBusinessLogic.DAL.T_ButdanhDAL obj = new HPCBusinessLogic.DAL.T_ButdanhDAL();
         this.txt_Author_name.Text = obj.GetBD_Name(_cateObj.AuthorID);
     }
 }
Ejemplo n.º 3
0
        public bool CheckPermission(int CatID)
        {
            HPCInfo.T_Album_Categories _cateObj = new HPCInfo.T_Album_Categories();
            HPCBusinessLogic.DAL.T_Album_CategoriesDAL _cateDAL = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL();
            _cateObj = _cateDAL.load_T_Album_Categories(CatID);
            Double trangthai = _cateObj.Cat_Album_Status_Approve;
            int    pageback  = 0;

            try { pageback = Convert.ToInt32(Session["PageFromID"].ToString()); }
            catch {; }
            if (pageback == 1)// chuc nang bien tap
            {
                if (trangthai != 1 && trangthai != 3)
                {
                    FileUpload1.Visible = false;
                    linkSave.Enabled    = false;
                    LinkCancel.Enabled  = false;
                    return(false);
                }
                else
                {
                    FileUpload1.Visible = true;
                    linkSave.Enabled    = true;
                    LinkCancel.Enabled  = true;
                    return(true);
                }
            }
            else if (pageback == 2)// chuc nang duyet bai
            {
                if (trangthai != 2 && trangthai != 5)
                {
                    FileUpload1.Visible = false;
                    linkSave.Enabled    = false;
                    LinkCancel.Enabled  = false;
                    return(false);
                }
                else
                {
                    FileUpload1.Visible = true;
                    linkSave.Enabled    = true;
                    LinkCancel.Enabled  = true;
                    return(true);
                }
            }
            else if (pageback == 3)// chuc nang xuat ban
            {
                if (trangthai != 4)
                {
                    FileUpload1.Visible = false;
                    linkSave.Enabled    = false;
                    LinkCancel.Enabled  = false;
                    return(false);
                }
                else
                {
                    FileUpload1.Visible = true;
                    linkSave.Enabled    = true;
                    LinkCancel.Enabled  = true;
                    return(true);
                }
            }
            else
            {
                FileUpload1.Visible = false;
                linkSave.Enabled    = false;
                LinkCancel.Enabled  = false;
                return(false);
            }
        }
Ejemplo n.º 4
0
        protected void linkSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                int pageback = 0;
                try { pageback = int.Parse(Session["PageFromID"].ToString()); }
                catch {; }
                if (pageback == 2 || pageback == 3)
                {
                    if (!string.IsNullOrEmpty(txt_tiennhanbut.Text))
                    {
                        try { int.Parse(txt_tiennhanbut.Text.Replace(",", "")); }
                        catch { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + CommonLib.ReadXML("lblXacnhanTien") + "');", true); return; }
                    }
                }
                HPCBusinessLogic.DAL.T_Album_CategoriesDAL _cateDAL = new HPCBusinessLogic.DAL.T_Album_CategoriesDAL();
                string strActionNotes = "";
                HPCInfo.T_Album_Categories _catObj = GetObject();

                int _return = _cateDAL.InsertT_Album_Categories(_catObj);

                if (_catObj.Cat_Album_ID == 0)
                {
                    strActionNotes = "[Thêm mới] [Thêm mới Phóng sự ảnh: " + _cateDAL.load_T_Album_Categories(_return).Cat_Album_Name + "]";
                }
                else
                {
                    strActionNotes = "[Cập nhật] [Cập nhật Phóng sự ảnh: " + _cateDAL.load_T_Album_Categories(_return).Cat_Album_Name + "]";
                }
                WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, _catObj.Cat_Album_Name, Request["Menu_ID"].ToString(), strActionNotes, 0, ConstAction.GocAnh);
                if (pageback == 3)
                {
                    #region Sync
                    // DONG BO ANH
                    try
                    {
                        SynFiles         _syncfile = new SynFiles();
                        T_Album_PhotoDAL _DAL      = new T_Album_PhotoDAL();
                        DataSet          _ds       = _DAL.Bind_T_Album_Photo(_return);
                        foreach (DataRow theRow in _ds.Tables[0].Rows)
                        {
                            string _img = theRow["Abl_Photo_Origin"].ToString();
                            if (_img.Trim().Length > 0)
                            {
                                _syncfile.SynData_UploadImgOne(_img, Global.ImagesService);
                            }
                        }
                    }
                    catch (Exception)
                    {
                        throw;
                    }

                    //END
                    #endregion
                }
                if (_catObj.Cat_Album_ID == 0)
                {
                    ResetForm();
                    Response.Redirect("~/PhongSuAnh/Album_List.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString() + "&Back=1");
                }
                else
                {
                    if (pageback == 1)
                    {
                        Response.Redirect("~/PhongSuAnh/Album_List.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString() + "&Back=1");
                    }
                    else if (pageback == 2)
                    {
                        Response.Redirect("~/PhongSuAnh/Approves_List.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString() + "&Back=1");
                    }
                    else if (pageback == 3)
                    {
                        Response.Redirect("~/PhongSuAnh/Approved_List.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString() + "&Back=1");
                    }
                    else
                    {
                        Response.Redirect("~/PhongSuAnh/Album_List.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString());
                    }
                }
            }
        }
Ejemplo n.º 5
0
        private HPCInfo.T_Album_Categories GetObject()
        {
            HPCInfo.T_Album_Categories _objCate = new HPCInfo.T_Album_Categories();
            if (Page.Request.Params["id"] != null)
            {
                _objCate.Cat_Album_ID = int.Parse(Page.Request["id"].ToString());
            }
            else
            {
                _objCate.Cat_Album_ID = 0;
            }
            _objCate.Cat_Album_Name = Txt_tieudeAbum.Text;
            _objCate.Lang_ID        = Convert.ToInt32(cbo_lanquage.SelectedValue);
            _objCate.Status         = true;// this.chkDisplay.Checked;
            if (txtOrder.Text.Length > 0)
            {
                if (UltilFunc.IsNumeric(this.txtOrder.Text.Trim()))
                {
                    _objCate.Possition = Convert.ToInt32(this.txtOrder.Text.Trim());
                }
            }
            _objCate.Links                   = "";
            _objCate.Cat_AlbumDesc           = this.txt_noidungAlbum.Text.Trim();
            _objCate.Target                  = true;
            _objCate.Copy_From               = 0;
            _objCate.Cat_Album_DateCreate    = DateTime.Now;
            _objCate.DateModify              = DateTime.Now;
            _objCate.UserCreated             = _user.UserID;
            _objCate.UserModify              = _user.UserID;
            _objCate.Cat_Album_DateSend      = DateTime.Now;
            _objCate.Cat_Album_DateApprove   = DateTime.Now;
            _objCate.Cat_Album_UserIDApprove = _user.UserID;
            int statusid = 1;

            try { statusid = int.Parse(lbl_status.Text); }
            catch {; }
            _objCate.Cat_Album_Status_Approve = statusid;
            if (this.cbo_chuyenmuc.SelectedIndex > 0)
            {
                _objCate.Cat_Album_CATID = int.Parse(cbo_chuyenmuc.SelectedValue);
            }
            else
            {
                _objCate.Cat_Album_CATID = 0;
            }
            _objCate.Tacgia = txt_Author_name.Text;
            //_objCate.Chatluong = ddlnews_chatluong.SelectedIndex;

            HPCBusinessLogic.DAL.T_ButdanhDAL obj = new HPCBusinessLogic.DAL.T_ButdanhDAL();
            T_Butdanh obj_BD    = new T_Butdanh();
            int       butdanhID = 0;

            if (!string.IsNullOrEmpty(txt_Author_name.Text.Trim()))
            {
                obj_BD.BD_ID   = 0;
                obj_BD.BD_Name = txt_Author_name.Text.Trim();
                obj_BD.UserID  = _user.UserID;
                butdanhID      = obj.Insert_Butdang(obj_BD);
            }
            _objCate.AuthorID = butdanhID;
            if (!string.IsNullOrEmpty(txt_tiennhanbut.Text))
            {
                _objCate.TongtienTT = int.Parse(txt_tiennhanbut.Text.Replace(",", ""));
            }
            else
            {
                _objCate.TongtienTT = 0;
            }
            //_objCate.Theloai = int.Parse(ddlNews_IsType.SelectedValue);
            //if (ddlnews_chatluong.SelectedIndex > 0)
            //    _objCate.Loaihinh = int.Parse(Drop_loaihinh.SelectedValue);
            //else
            //    _objCate.Loaihinh = 0;

            //_objCate.NguoichamNBID = _user.UserID;
            //_objCate.NgaychamNB = DateTime.Now;
            //_objCate.HesoTT = 0.0;
            _objCate.Comment = txtGhichu.Text;
            return(_objCate);
        }