Exemplo n.º 1
0
 private void PopulateItem(int _id)
 {
     HPCInfo.T_Customer_Ads _cateObj = new HPCInfo.T_Customer_Ads();
     HPCBusinessLogic.DAL.T_Customer_AdsDAL _cateDAL = new HPCBusinessLogic.DAL.T_Customer_AdsDAL();
     _cateObj = _cateDAL.load_T_Customer_Ads(_id);
     if (_cateObj != null)
     {
         Txt_DiachiQC.Text = _cateObj.URL.ToString();
         if (_cateObj.Start_Date.ToString().Length > 0)
         {
             txt_ngaybatdau.Text = _cateObj.Start_Date.ToString("dd/MM/yyyy");
         }
         else
         {
             txt_ngaybatdau.Text = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss");
         }
         if (_cateObj.End_Date.ToString().Length > 0)
         {
             txt_ngayketthuc.Text = _cateObj.End_Date.ToString("dd/MM/yyyy");
         }
         else
         {
             txt_ngayketthuc.Text = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss");
         }
         txtOrder.Text       = _cateObj.Order_Number.ToString();
         this.txtWidth.Text  = _cateObj.Width.ToString().Trim();
         this.txtHeight.Text = _cateObj.Height.ToString().Trim();
         txtImageVideo.Text  = _cateObj.Ads_ImgVideo.ToString();
         txtThumbnail.Text   = _cateObj.Ads_Images.ToString();
         //if (_cateObj.Ads_ImgVideo.Length > 0)
         //    this.ImagesVd.Src = _cateObj.Ads_ImgVideo;
         //if (_cateObj.Ads_Images.Length > 0)
         //    this.ImgTemp.Src =_cateObj.Ads_Images;
         cbo_Khachhang.SelectedValue     = _cateObj.Cust_ID.ToString();
         cbo_lanquage.SelectedValue      = _cateObj.Lang_ID.ToString();
         cbo_Vitri_hienthi.SelectedValue = _cateObj.Possittion.ToString();
         cbo_Display.SelectedValue       = _cateObj.Target.ToString();
         txtMota.Text = _cateObj.DisplayType.ToString();
         if (_cateObj.Status == 1)
         {
             chkDisplay.Checked = true;
         }
         else
         {
             chkDisplay.Checked = false;
         }
         if (_cateObj.Cat_ID.ToString().ToLower() == "all")
         {
             this.cbo_Category.SelectedValue = _cateObj.Cat_ID.ToString();
             //this.cbo_Category.UpdateAfterCallBack = true;
             System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "javascript", "javascript: SetDisplay('none');", true);
         }
         else
         {
             this.cbo_Category.SelectedValue = "CM";
             //this.cbo_Category.UpdateAfterCallBack = true;
             System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(string), "javascript", "javascript: SetDisplay('block');", true);
         }
     }
 }
Exemplo n.º 2
0
 private HPCInfo.T_Customer_Ads GetObject()
 {
     HPCInfo.T_Customer_Ads _objCate = new HPCInfo.T_Customer_Ads();
     HPCBusinessLogic.DAL.T_Customer_AdsDAL _CateDAL = new HPCBusinessLogic.DAL.T_Customer_AdsDAL();
     if (Page.Request["id"] != null)
     {
         _objCate.ID = int.Parse(Page.Request["id"].ToString());
         _objCate    = _CateDAL.GetOneFromT_Customer_AdsByID(int.Parse(Page.Request["id"].ToString()));
     }
     else
     {
         _objCate.ID          = 0;
         _objCate.DateCreated = DateTime.Now;
         _objCate.UserCreated = _user.UserID;
     }
     _objCate.Ads_ImgVideo = txtImageVideo.Text;
     //_objCate.Ads_Images = txtThumbnail.Text;
     //_objCate.AdvType = AdsPosDAL.getAdvType(txtThumbnail.Text);
     _objCate.Possittion = 1;
     if (txtOrder.Text.Length > 0)
     {
         _objCate.Order_Number = int.Parse(txtOrder.Text);
     }
     _objCate.URL         = Txt_DiachiQC.Text;
     _objCate.DisplayType = txtMota.Text;
     if (chkDisplay.Checked == true)
     {
         _objCate.Status = 1;
     }
     else
     {
         _objCate.Status = 0;
     }
     return(_objCate);
 }
Exemplo n.º 3
0
        public int InsertT_Customer_Ads(HPCInfo.T_Customer_Ads obj)
        {
            int _inserted;

            try
            {
                _inserted = HPCDataProvider.Instance().InsertObjectReturn(obj, "[CMS_InsertT_Customer_Ads]");
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_inserted);
        }
Exemplo n.º 4
0
 protected void linkSave_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         HPCBusinessLogic.DAL.T_Customer_AdsDAL _cateDAL = new HPCBusinessLogic.DAL.T_Customer_AdsDAL();
         HPCInfo.T_Customer_Ads _catObj = GetObject();
         if (_catObj.ID == 0)
         {
             int _return = _cateDAL.InsertT_Customer_Ads(_catObj);
             WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "Khách hàng :" + cbo_Khachhang.SelectedItem.Text,
                                                            Request["Menu_ID"].ToString(), "[CẬP NHẬT THÔNG LOGO QUẢNG CÁO]-->[Thêm mới thông tin quảng cáo]ID:" + _catObj.ID.ToString() + " ]", 0, 0);
         }
         else
         {
             _cateDAL.InsertT_Customer_Ads(_catObj);
             WriteLogHistory2Database.WriteHistory2Database(_user.UserID, _user.UserFullName, "Khách hàng :" + cbo_Khachhang.SelectedItem.Text,
                                                            Request["Menu_ID"].ToString(), "[CẬP NHẬT THÔNG LOGO QUẢNG CÁO]-->[Sửa thông tin quảng cáo]ID:" + _catObj.ID.ToString() + " ]", 0, 0);
         }
         Page.Response.Redirect("~/Quangcao/AdsLogoList.aspx?Menu_ID=" + this.Page.Request["Menu_ID"].ToString());
     }
 }
Exemplo n.º 5
0
 private void PopulateItem(int _id)
 {
     HPCInfo.T_Customer_Ads _cateObj = new HPCInfo.T_Customer_Ads();
     HPCBusinessLogic.DAL.T_Customer_AdsDAL _cateDAL = new HPCBusinessLogic.DAL.T_Customer_AdsDAL();
     _cateObj = _cateDAL.load_T_Customer_Ads(_id);
     if (_cateObj != null)
     {
         Txt_DiachiQC.Text  = _cateObj.URL.ToString();
         txtOrder.Text      = _cateObj.Order_Number.ToString();
         txtImageVideo.Text = _cateObj.Ads_ImgVideo.ToString();
         //txtThumbnail.Text = _cateObj.Ads_Images.ToString();
         txtMota.Text = _cateObj.DisplayType.ToString();
         if (_cateObj.Status == 1)
         {
             chkDisplay.Checked = true;
         }
         else
         {
             chkDisplay.Checked = false;
         }
     }
 }
Exemplo n.º 6
0
 private HPCInfo.T_Customer_Ads GetObject()
 {
     HPCInfo.T_Customer_Ads _objCate = new HPCInfo.T_Customer_Ads();
     HPCBusinessLogic.DAL.T_Customer_AdsDAL _CateDAL = new HPCBusinessLogic.DAL.T_Customer_AdsDAL();
     if (Page.Request["id"] != null)
     {
         _objCate.ID = int.Parse(Page.Request["id"].ToString());
         _objCate    = _CateDAL.GetOneFromT_Customer_AdsByID(int.Parse(Page.Request["id"]));
     }
     else
     {
         _objCate.ID          = 0;
         _objCate.DateCreated = DateTime.Now;
         _objCate.UserCreated = _user.UserID;
     }
     _objCate.Cat_ID = getListCateAdsDisplay(this.cbo_Category.SelectedValue.ToString());
     if (int.Parse(cbo_Khachhang.SelectedIndex.ToString()) > 0)
     {
         _objCate.Cust_ID = int.Parse(cbo_Khachhang.SelectedValue);
     }
     if (int.Parse(cbo_lanquage.SelectedIndex.ToString()) > 0)
     {
         _objCate.Lang_ID = int.Parse(cbo_lanquage.SelectedValue);
     }
     _objCate.Ads_ImgVideo = txtImageVideo.Text;
     _objCate.Ads_Images   = txtThumbnail.Text;
     _objCate.AdvType      = AdsPosDAL.getAdvType(txtThumbnail.Text);
     if (!string.IsNullOrEmpty(txt_ngaybatdau.Text))
     {
         _objCate.Start_Date = CommonLib.ToDate(txt_ngaybatdau.Text, "dd/MM/yyyy HH:mm:ss:tt");
     }
     else
     {
         _objCate.Start_Date = DateTime.Now;
     }
     if (!string.IsNullOrEmpty(txt_ngayketthuc.Text))
     {
         _objCate.End_Date = CommonLib.ToDate(txt_ngayketthuc.Text, "dd/MM/yyyy HH:mm:ss:tt");
     }
     else
     {
         _objCate.End_Date = DateTime.Now;
     }
     if (int.Parse(cbo_Vitri_hienthi.SelectedValue.ToString()) > 0)
     {
         _objCate.Possittion = int.Parse(cbo_Vitri_hienthi.SelectedValue.ToString());
     }
     if (txtOrder.Text.Length > 0)
     {
         _objCate.Order_Number = int.Parse(txtOrder.Text);
     }
     if (this.txtHeight.Text.Length > 0)
     {
         _objCate.Height = this.txtHeight.Text.Trim();
     }
     if (this.txtWidth.Text.Length > 0)
     {
         if (UltilFunc.IsNumeric(this.txtWidth.Text.Trim()))
         {
             _objCate.Width = this.txtWidth.Text.Trim();
         }
     }
     _objCate.URL = Txt_DiachiQC.Text;
     if (int.Parse(cbo_Display.SelectedIndex.ToString()) > 0)
     {
         _objCate.Target = int.Parse(cbo_Display.SelectedValue.ToString());
     }
     _objCate.DisplayType = txtMota.Text;
     if (chkDisplay.Checked == true)
     {
         _objCate.Status = 1;
     }
     else
     {
         _objCate.Status = 0;
     }
     return(_objCate);
 }