コード例 #1
0
        private HPCInfo.T_Photo_Event GetObject()
        {
            HPCInfo.T_Photo_Event _objPoto = new HPCInfo.T_Photo_Event();
            T_Photo_EventDAL      _DAL     = new T_Photo_EventDAL();

            if (Page.Request.Params["id"] != null)
            {
                _objPoto.Photo_ID    = int.Parse(Page.Request["id"].ToString());
                _objPoto             = _DAL.GetOneFromT_Photo_EventsByID(double.Parse(Page.Request["id"].ToString()));
                _objPoto.Date_Update = DateTime.Now;
            }
            else
            {
                _objPoto.Photo_ID    = 0;
                _objPoto.Date_Update = DateTime.Now;
            }
            int       butdanhID = 0;
            T_Butdanh obj_BD    = new T_Butdanh();

            HPCBusinessLogic.DAL.T_ButdanhDAL obj = new HPCBusinessLogic.DAL.T_ButdanhDAL();
            if (!string.IsNullOrEmpty(txt_Authod_Name.Text))
            {
                obj_BD.BD_ID   = 0;
                obj_BD.UserID  = _user.UserID;
                obj_BD.BD_Name = txt_Authod_Name.Text.Trim();
                butdanhID      = obj.Insert_Butdang(obj_BD);
            }
            _objPoto.AuthorID     = butdanhID;
            _objPoto.Photo_Name   = txt_Abl_Photo_Name.Text;
            _objPoto.Photo_Medium = UrlPathImage_RemoveUpload(txtThumbnail.Text);
            //_objPoto.File_Size = this.txt_Dungluong.Text.Trim();
            //if (txt_Dungluong.Text.Length > 0)
            //    if (UltilFunc.IsNumeric(this.txt_Dungluong.Text.Trim()))
            //        _objPoto.FileSquare = this.txt_Dungluong.Text.Trim();
            //_objPoto.File_Type = txt_loaifile.Text;
            _objPoto.Author_Name = txt_Authod_Name.Text;
            _objPoto.Lang_ID     = Convert.ToInt32(cboNgonNgu.SelectedValue);
            _objPoto.Date_Create = DateTime.Now;
            _objPoto.Creator     = _user.UserID;
            _objPoto.Photo_Desc  = txtGhichu.Text;
            if (Page.Request["Tab"] != null)
            {
                tab = Convert.ToInt32(Page.Request["Tab"].ToString());
            }
            if (tab == 0)
            {
                _objPoto.Photo_Status = 5;
            }
            else if (tab == -1)
            {
                _objPoto.Photo_Status = 5;
            }
            else if (tab == 1)
            {
                _objPoto.Photo_Status = 7;
            }
            _objPoto.Copy_From = 0;
            return(_objPoto);
        }
コード例 #2
0
        protected void cmd_chamall_Click(object sender, EventArgs e)
        {
            HPCBusinessLogic.DAL.T_ButdanhDAL obj_BD_DAL = new HPCBusinessLogic.DAL.T_ButdanhDAL();
            HPCBusinessLogic.ImageFilesDAL    obj        = new HPCBusinessLogic.ImageFilesDAL();
            int type = 1; try { type = int.Parse(Request["TypeID"].ToString()); }

            catch {; }
            if (checkCham.Checked)
            {
                int tien = 0;
                if (!string.IsNullOrEmpty(txt_tienNB.Text.Trim()))
                {
                    try { tien = int.Parse(txt_tienNB.Text.Trim().Replace(",", "")); }
                    catch { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alrt('Tiền phải nhập kiểu số nguyên');", true); return; }
                    foreach (DataGridItem item in dgr_anh.Items)
                    {
                        int   newid        = int.Parse(lbl_News_ID.Text);
                        Label lbl_Image_ID = (Label)item.FindControl("lbl_Image_ID");
                        int   ImageID      = int.Parse(lbl_Image_ID.Text);

                        HPCBusinessLogic.DAL.T_NewsDAL _Obj = new HPCBusinessLogic.DAL.T_NewsDAL();
                        _Obj.Update_TiennhanbutAnh(type, newid, int.Parse(lbl_Image_ID.Text), tien, _user.UserID);

                        WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, " ",
                                                                       Request["Menu_ID"].ToString(), "Duyệt ảnh ", int.Parse(lbl_Image_ID.Text), ConstAction.BaoDT);
                    }
                }
            }
            else
            {
                foreach (DataGridItem item in dgr_anh.Items)
                {
                    TextBox txt_tiennhanbut = (TextBox)item.FindControl("txt_tiennhanbut");
                    if (!string.IsNullOrEmpty(txt_tiennhanbut.Text))
                    {
                        try { int.Parse(txt_tiennhanbut.Text.Replace(",", "")); }
                        catch { System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alrt('Tiền phải nhập kiểu số nguyên');", true); return; }
                    }
                }
                foreach (DataGridItem item in dgr_anh.Items)
                {
                    TextBox txt_tiennhanbut = (TextBox)item.FindControl("txt_tiennhanbut");
                    int     newid           = int.Parse(lbl_News_ID.Text);
                    Label   lbl_Image_ID    = (Label)item.FindControl("lbl_Image_ID");
                    int     ImageID         = int.Parse(lbl_Image_ID.Text);
                    int     tien            = 0;
                    if (!string.IsNullOrEmpty(txt_tiennhanbut.Text))
                    {
                        tien = int.Parse(txt_tiennhanbut.Text.Replace(",", ""));
                    }

                    HPCBusinessLogic.DAL.T_NewsDAL _Obj = new HPCBusinessLogic.DAL.T_NewsDAL();
                    _Obj.Update_TiennhanbutAnh(type, newid, ImageID, tien, _user.UserID);
                    WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, " ",
                                                                   Request["Menu_ID"].ToString(), "Duyệt ảnh ", int.Parse(lbl_Image_ID.Text), ConstAction.BaoDT);
                }
            }
            LoadImage();
        }
コード例 #3
0
        private T_Photo_Event setItem(double PhotoID, string urlImage, string PhotoTitle, double LangId, string tacgia, string tienNB, string ghichu, double status)
        {
            T_Photo_Event    _objPoto = new T_Photo_Event();
            T_Photo_EventDAL _DAL     = new T_Photo_EventDAL();
            int       butdanhID       = 0;
            T_Butdanh obj_BD          = new T_Butdanh();

            HPCBusinessLogic.DAL.T_ButdanhDAL obj = new HPCBusinessLogic.DAL.T_ButdanhDAL();
            if (!string.IsNullOrEmpty(tacgia))
            {
                obj_BD.BD_ID   = 0;
                obj_BD.UserID  = _user.UserID;
                obj_BD.BD_Name = tacgia.Trim();
                butdanhID      = obj.Insert_Butdang(obj_BD);
            }
            _objPoto.AuthorID = butdanhID;
            int tien = 0;

            if (!string.IsNullOrEmpty(tienNB))
            {
                try { tien = int.Parse(tienNB.Replace(",", "")); }
                catch {; }
            }
            _objPoto.Photo_ID = PhotoID;
            //_objPoto = _DAL.GetOneFromT_Photo_EventsByID(PhotoID);
            _objPoto.Date_Update  = DateTime.Now;
            _objPoto.Photo_Name   = PhotoTitle;
            _objPoto.Photo_Medium = urlImage;
            _objPoto.Author_Name  = tacgia;
            _objPoto.TienNB       = tien;
            _objPoto.Lang_ID      = LangId;
            _objPoto.Creator      = _user.UserID;
            _objPoto.Photo_Status = status;
            _objPoto.Photo_Desc   = ghichu;
            return(_objPoto);
        }
コード例 #4
0
        private T_Photo_Event GetObject()
        {
            T_Photo_Event    _objPoto = new T_Photo_Event();
            T_Photo_EventDAL _DAL     = new T_Photo_EventDAL();

            if (Page.Request.Params["id"] != null)
            {
                _objPoto.Photo_ID    = int.Parse(Page.Request["id"].ToString());
                _objPoto             = _DAL.GetOneFromT_Photo_EventsByID(double.Parse(Page.Request["id"].ToString()));
                _objPoto.Date_Update = DateTime.Now;
            }
            else
            {
                _objPoto.Photo_ID    = 0;
                _objPoto.Date_Update = DateTime.Now;
            }
            int       butdanhID = 0;
            T_Butdanh obj_BD    = new T_Butdanh();

            HPCBusinessLogic.DAL.T_ButdanhDAL obj = new HPCBusinessLogic.DAL.T_ButdanhDAL();
            if (!string.IsNullOrEmpty(txt_Authod_Name.Text))
            {
                obj_BD.BD_ID   = 0;
                obj_BD.UserID  = _user.UserID;
                obj_BD.BD_Name = txt_Authod_Name.Text.Trim();
                butdanhID      = obj.Insert_Butdang(obj_BD);
            }
            _objPoto.AuthorID     = butdanhID;
            _objPoto.Photo_Name   = txt_Abl_Photo_Name.Text;
            _objPoto.Photo_Medium = UrlPathImage_RemoveUpload(txtThumbnail.Text);
            _objPoto.Author_Name  = txt_Authod_Name.Text;
            int tien = 0;

            if (this.txtTienNhuanBut.Text.Trim().Length > 0)
            {
                tien = int.Parse(txtTienNhuanBut.Text.Replace(",", ""));
                if (tien > 0)
                {
                    _objPoto.TienNB = tien;
                }
                else
                {
                    _objPoto.TienNB = 0;
                }
            }
            _objPoto.Lang_ID     = Convert.ToInt32(cboNgonNgu.SelectedValue);
            _objPoto.Date_Update = DateTime.Now;
            _objPoto.Photo_Desc  = txtGhichu.Text;
            //_objPoto.Photo_Name = txt_Abl_Photo_Name.Text;
            //_objPoto.Photo_Medium = UrlPathImage_RemoveUpload(txtThumbnail.Text);
            //_objPoto.Author_Name = txt_Authod_Name.Text;
            //_objPoto.Lang_ID = Convert.ToInt32(cboNgonNgu.SelectedValue);

            if (Page.Request["Tab"] != null)
            {
                tab = Convert.ToInt32(Page.Request["Tab"].ToString());
            }
            if (tab == 0)
            {
                _objPoto.Photo_Status = 8;
            }
            else if (tab == -1)
            {
                _objPoto.Photo_Status = 8;
            }
            _objPoto.Copy_From = 0;
            return(_objPoto);
        }