private void PopulateItem(int _id)
 {
     HPCInfo.T_Photo_Event             _Obj      = new HPCInfo.T_Photo_Event();
     HPCBusinessLogic.T_Photo_EventDAL _untilDAL = new HPCBusinessLogic.T_Photo_EventDAL();
     _Obj = _untilDAL.GetOneFromT_Photo_EventsByID(_id);
     if (_Obj != null)
     {
         this.txt_Abl_Photo_Name.Text = _Obj.Photo_Name.ToString();
         this.txtThumbnail.Text       = _Obj.Photo_Medium.ToString();
         if (_Obj.Photo_Thumnail.Length > 2)
         {
             this.ImgTemp.Src = HPCComponents.Global.TinPathBDT + _Obj.Photo_Thumnail;
         }
         this.txt_Authod_Name.Text = _Obj.Author_Name.ToString();
         if (_Obj.TienNB > 0.0)
         {
             this.txtTienNhuanBut.Text = string.Format("{0:#,#}", _Obj.TienNB).Replace(".", ",");
         }
         this.cboNgonNgu.SelectedIndex = UltilFunc.GetIndexControl(cboNgonNgu, _Obj.Lang_ID.ToString());
         this.txtGhichu.Text           = _Obj.Photo_Desc.ToString();
     }
     //HPCInfo.T_Photo_Event _Obj = new HPCInfo.T_Photo_Event();
     //HPCBusinessLogic.T_Photo_EventDAL _untilDAL = new HPCBusinessLogic.T_Photo_EventDAL();
     //_Obj = _untilDAL.GetOneFromT_Photo_EventsByID(_id);
     //if (_Obj != null)
     //{
     //    txt_Abl_Photo_Name.Text = _Obj.Photo_Name.ToString();
     //    txtThumbnail.Text = _Obj.Photo_Medium.ToString();
     //    cboNgonNgu.SelectedIndex = UltilFunc.GetIndexControl(cboNgonNgu, _Obj.Lang_ID.ToString());
     //    this.txt_Authod_Name.Text = _Obj.Author_Name.ToString();
     //    if (_Obj.Photo_Thumnail.Length > 2)
     //        this.ImgTemp.Src = HPCComponents.Global.TinPathBDT + _Obj.Photo_Thumnail;
     //}
 }
Esempio n. 2
0
 private void PopulateItem(int _id)
 {
     HPCInfo.T_Photo_Event             _Obj      = new HPCInfo.T_Photo_Event();
     HPCBusinessLogic.T_Photo_EventDAL _untilDAL = new HPCBusinessLogic.T_Photo_EventDAL();
     _Obj = _untilDAL.GetOneFromT_Photo_EventsByID(_id);
     if (_Obj != null)
     {
         this.txt_Abl_Photo_Name.Text = _Obj.Photo_Name.ToString();
         this.txtThumbnail.Text       = _Obj.Photo_Medium.ToString();
         if (_Obj.Photo_Thumnail.Length > 2)
         {
             this.ImgTemp.Src = HPCComponents.Global.TinPathBDT + _Obj.Photo_Thumnail;
         }
         this.txt_Authod_Name.Text     = _Obj.Author_Name.ToString();
         this.cboNgonNgu.SelectedIndex = UltilFunc.GetIndexControl(cboNgonNgu, _Obj.Lang_ID.ToString());
         this.txtGhichu.Text           = _Obj.Photo_Desc.ToString();
     }
 }
Esempio n. 3
0
 protected void linkSave_Click(object sender, EventArgs e)
 {
     //if (!Page.IsValid) return;
     HPCBusinessLogic.T_Photo_EventDAL _untilDAL = new HPCBusinessLogic.T_Photo_EventDAL();
     HPCInfo.T_Photo_Event             _Obj      = GetObject();
     if (_Obj.Photo_ID == 0)
     {
         int    _return      = _untilDAL.InsertT_Photo_Events(_Obj);
         string _ActionsCode = "[Thời sự qua ảnh] [Thêm mới ảnh] [Ảnh: " + _untilDAL.GetOneFromT_Photo_EventsByID(Convert.ToDouble(_return.ToString())).Photo_Name + "]";
         WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Thêm mới]", Convert.ToInt32(Request["Menu_ID"]), _ActionsCode, _return, ConstAction.TSAnh);
         System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("VALIDATE_ADDNEWS") + "');", true);
     }
     else
     {
         int    _return      = _untilDAL.InsertT_Photo_Events(_Obj);
         string _ActionsCode = "[Thời sự qua ảnh] [Cập nhật ảnh] [Ảnh: " + _Obj.Photo_Name + "]";
         WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "[Cập nhật]", Convert.ToInt32(Request["Menu_ID"]), _ActionsCode, _return, ConstAction.TSAnh);
         System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "alert('" + Global.RM.GetString("VALIDATE_ADDNEWS") + "');", true);
     }
     if (Page.Request["Tab"].ToString() != "-1")
     {
         if (Page.Request["Menu_ID"] != null)
         {
             Page.Response.Redirect("~/Anh24h/List_PhotosDexuat.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString() + "&Tab=" + Page.Request["Tab"].ToString());
         }
         else
         {
             return;
         }
     }
     else
     {
         if (Page.Request["Menu_ID"] != null)
         {
             Page.Response.Redirect("~/Anh24h/List_PhotosDexuat.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString());
         }
         else
         {
             return;
         }
     }
 }