コード例 #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
        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);
        }
コード例 #3
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);
        }