Esempio n. 1
0
        protected void dtgReturnList_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            try
            {
                switch (e.CommandName)
                {
                case "deploywaiting":
                    ContentDB.SetStatus(ConvertUtility.ToInt32(e.Item.Cells[0].Text), (int)AppEnv.CMSWorkFlow.Waiting);
                    lblStatusUpdate.Text = AppEnv.MSG_Waiting + dropZones.SelectedItem.Text;
                    break;

                case "delete":
                    ContentDB.Delete(ConvertUtility.ToInt32(e.Item.Cells[0].Text));
                    lblStatusUpdate.Text = MiscUtility.UPDATE_SUCCESS;
                    break;

                case "edit":
                    Response.Redirect(AppEnv.ADMIN_CMD + "cmseditcontent&contentid=" + ConvertUtility.ToInt32(e.Item.Cells[0].Text));
                    break;
                }
            }
            catch
            {
                lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
            }
        }
 protected void dtgWaitingDeployList_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     if (e.CommandName == "return")
     {
         try
         {
             ContentDB.SetStatus(ConvertUtility.ToInt32(e.Item.Cells[0].Text), (int)AppEnv.CMSWorkFlow.Return);
             ContentDB.SetComment(ConvertUtility.ToInt32(e.Item.Cells[0].Text), Convert.ToChar(34) + txtComment.Text + Convert.ToChar(34) + "\r\n Trả lại bởi : " + CurrentAdminInfo.User_FullName);
             lblStatusUpdate.Text = AppEnv.MSG_Return + dropZones.SelectedItem.Text;
             txtComment.Text      = string.Empty;
         }
         catch
         {
             lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
         }
     }
     if (e.CommandName == "deploy")
     {
         try
         {
             ContentDB.SetStatus(ConvertUtility.ToInt32(e.Item.Cells[0].Text), (int)AppEnv.CMSWorkFlow.Deploy);
             lblStatusUpdate.Text = AppEnv.MSG_Deploy + dropZones.SelectedItem.Text;
             DistributionInfo info = new DistributionInfo();
             info.Distribution_ContentID = ConvertUtility.ToInt32(e.Item.Cells[0].Text);
             info.Distribution_ZoneID    = ConvertUtility.ToInt32(dropZones.SelectedValue);
             info.Distribution_Rank      = (int)AppEnv.CMSContentRank.Default;
             DistributionDB.Insert(info);
         }
         catch
         {
             lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
         }
     }
 }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                ContentDB.DeleteTemp();
            }
            catch (Exception)
            {
                MessageBox.Show("Có lỗi trong quá trình dọn Temp");
                throw;
            }

            var info = GetContent();

            var newContentId = ContentDB.Insert(info);

            if (newContentId > 0)
            {
                Response.Redirect(AppEnv.ADMIN_CMD + "cmseditcontent" + "&contentid=" + newContentId);
            }
            else
            {
                MessageBox.Show("Không tạo được ID mới");
                return;
            }
        }
Esempio n. 4
0
        //private string curDateString;

        protected void Page_Load(object sender, EventArgs e)
        {
            contentInfo = ContentDB.GetInfo(ConvertUtility.ToInt32(Request.QueryString["contentid"]));
            if (contentInfo == null)
            {
                Response.Redirect(AppEnv.ADMIN_ACCESSDENY);
            }
            //curDateString = contentInfo.Content_CreateDate.Year + "_" + contentInfo.Content_CreateDate.Month + "_" + contentInfo.Content_CreateDate.Day;

            isManager  = RoleDB.CheckRole(CurrentAdminInfo.User_ID, (int)AppEnv.CMSRole.Manager);
            isDeployer = RoleDB.CheckRole(CurrentAdminInfo.User_ID, (int)AppEnv.CMSRole.Deployer);
            isCreater  = RoleDB.CheckRole(CurrentAdminInfo.User_ID, (int)AppEnv.CMSRole.Creater);

            //string userUploadPath = Constants.UploadPath + contentInfo.Content_UserID + "/" + curDateString;
            //Editor1.UploadDir = userUploadPath;
            //txtAttachFile.fpUploadDir = userUploadPath;
            //txtAvatar.fpUploadDir = userUploadPath;

            //Editor1.UploadDir = Constants.UploadContent;
            //txtAttachFile.fpUploadDir = Constants.UploadAvatar;
            //txtAvatar.fpUploadDir = Constants.UploadAvatar;

            if (!IsPostBack)
            {
                LoadZones();
            }
            lblStatusUpdate.Text = string.Empty;
        }
Esempio n. 5
0
        protected void dtgWaitingDeployList_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            int contentID = ConvertUtility.ToInt32(e.Item.Cells[0].Text);

            if (e.CommandName == "deploywaiting")
            {
                try
                {
                    ContentDB.SetStatus(contentID, (int)AppEnv.CMSWorkFlow.Waiting);
                    lblStatusUpdate.Text = "<font color='blue'>Bài đã được gửi lên mục chờ đăng '" + dropZones.SelectedItem.Text + "'</font>";
                }
                catch
                {
                    lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
                }
            }
            if (e.CommandName == "delete")
            {
                try
                {
                    ContentDB.Delete(contentID);
                    lblStatusUpdate.Text = MiscUtility.UPDATE_SUCCESS;
                }
                catch
                {
                    lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
                }
            }
            if (e.CommandName == "edit")
            {
                Response.Redirect(AppEnv.ADMIN_CMD + "cmseditcontent&contentid=" + contentID);
            }
            dropZones_SelectedIndexChanged(null, null);
        }
Esempio n. 6
0
        protected void dropZones_SelectedIndexChanged(object sender, EventArgs e)
        {
            int zoneID = ConvertUtility.ToInt32(dropZones.SelectedValue);

            AppEnv.ZoneSelected             = zoneID;
            dtgWaitingDeployList.DataSource = ContentDB.GetContentsByUserID(zoneID, (int)AppEnv.CMSWorkFlow.Archive, CurrentAdminInfo.User_ID);
            dtgWaitingDeployList.DataBind();
        }
Esempio n. 7
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            int zoneID = ConvertUtility.ToInt32(dropZones.SelectedValue);

            AppEnv.ZoneSelected      = zoneID;
            dtgReturnList.DataSource = ContentDB.GetContentsByUserID(zoneID, (int)AppEnv.CMSWorkFlow.Return, CurrentAdminInfo.User_ID);
            dtgReturnList.DataBind();
        }
Esempio n. 8
0
 private void TestSwatches()
 {
     using (ContentDB db = new ContentDB()) {
         //var query = db.Database.SqlQuery<VRefPathway>("SELECT * FROM VRefPathways");
         //db.VRefPathways.Load();
         string temp = string.Empty;
         MessageConfirmBox.Show("",
                                $"NormalizedSizeMain {Settings.Instance.GetNormalizedImageWidth(ContentWorkMode.Main)}" +
                                $"\nNormalizedSizeFolders {Settings.Instance.GetNormalizedImageWidth(ContentWorkMode.Folders)}" +
                                $"\nSizePageMain {Settings.Instance.GetSizePageImageLoad(ContentWorkMode.Main)}" +
                                $"\nSizePageFolders {Settings.Instance.GetSizePageImageLoad(ContentWorkMode.Folders)}");
     }
     //MessageConfirmBox.Show(Settings.Instance.AppImageUrl,$"{ModelUtilities.Instance.GetId<RefPathway>(@"C:\PgkPrivate\Private\ФОТО РОДНЫЕ1")}", "Test");
 }
Esempio n. 9
0
        protected void dtgReturnList_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0)
            {
                return;
            }
            HyperLink lnkHeadline = (HyperLink)e.Item.FindControl("lnkHeadline");

            lnkHeadline.Text        = ContentDB.GetName(Convert.ToInt32(e.Item.Cells[0].Text));
            lnkHeadline.NavigateUrl = AppEnv.ADMIN_CMD + "cmsviewcontent&contentid=" + e.Item.Cells[0].Text;
            lnkHeadline.ToolTip     = ContentDB.GetAuthorInfoByContentID(Convert.ToInt32(e.Item.Cells[0].Text));
            Button cmdDel = (Button)e.Item.FindControl("cmdDel");

            cmdDel.Attributes.Add("onclick", MiscUtility.DELETE_CONFIRM);
        }
Esempio n. 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zoneCurrent = ZoneUtility.GetZoneCurrent();

            _itemid = ConvertUtility.ToInt32(Request.QueryString["itemid"]);

            _distInfo = DistributionDB.GetInfo(_itemid);
            if (_distInfo == null)
            {
                Visible = false;
                return;
            }

            DistributionDB.UpdateView(_distInfo.Distribution_ID, 1);

            _contentId = _distInfo.Distribution_ContentID;

            var contentInfo = ContentDB.GetInfo(_contentId);

            lnkName.Text        = contentInfo.Content_Name;
            lnkName.NavigateUrl = UrlFilter.BuildUrlByItemID(_itemid);



            lnkZone.Text        = ZoneDB.GetZoneNameByID(_zoneCurrent);
            lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zoneCurrent);

            var strSQL = "SELECT CMS_ContentVideo.*, CMS_Videos.* FROM CMS_ContentVideo ";

            strSQL += " INNER JOIN CMS_Videos ON CMS_ContentVideo.Video_ID = CMS_Videos.Video_ID ";
            strSQL += " WHERE 1=1 ";

            strSQL += " AND CMS_ContentVideo.Content_ID=" + _contentId + " ";
            strSQL += " AND CMS_Videos.Video_Visible=1 ";
            strSQL += " ORDER BY CMS_ContentVideo.Priority ASC ";

            var source = DataHelper.GetDataFromTable(strSQL);

            if (source.Rows.Count > 0)
            {
                rptData.DataSource = source;
                rptData.DataBind();
            }
            else
            {
                rptData.Visible = false;
            }
        }
Esempio n. 11
0
        protected void dtgDeployList_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            try
            {
                switch (e.CommandName)
                {
                case "updaterank":
                    if (isManager || isDeployer)
                    {
                        foreach (DataGridItem item in dtgDeployList.Items)
                        {
                            DropDownList dropContentRank = (DropDownList)item.FindControl("dropContentRank");
                            DistributionDB.SetRank(ConvertUtility.ToInt32(item.Cells[0].Text), ConvertUtility.ToInt32(dropContentRank.SelectedValue));
                        }
                    }
                    break;

                case "updatepriority":
                    if (isManager || isDeployer)
                    {
                        foreach (DataGridItem item in dtgDeployList.Items)
                        {
                            DropDownList dropIndex = (DropDownList)item.FindControl("dropIndex");
                            DistributionDB.SetPriority(ConvertUtility.ToInt32(item.Cells[0].Text), ConvertUtility.ToInt32(dropIndex.SelectedValue));
                        }
                    }
                    break;

                case "remover":
                    DistributionDB.Delete(ConvertUtility.ToInt32(e.Item.Cells[0].Text));
                    break;

                case "delete":
                    // xoa anh?
                    ContentDB.Delete(ConvertUtility.ToInt32(e.Item.Cells[1].Text));
                    break;

                case "edit":
                    Response.Redirect(AppEnv.ADMIN_CMD + "cmseditcontent&contentid=" + ConvertUtility.ToInt32(e.Item.Cells[1].Text));
                    break;
                }
                lblStatusUpdate.Text = MiscUtility.UPDATE_SUCCESS;
            }
            catch
            {
                lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
            }
        }
Esempio n. 12
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            int zoneID = ConvertUtility.ToInt32(dropZones.SelectedValue);

            AppEnv.ZoneSelected = zoneID;
            if (isManager)
            {
                dtgReturnList.DataSource = ContentDB.GetDocuments(zoneID);
            }
            else
            {
                dtgReturnList.DataSource = ContentDB.GetDocumentsByUserID(zoneID, CurrentAdminInfo.User_ID);
            }
            dtgReturnList.DataBind();
        }
Esempio n. 13
0
    void Awake()
    {
        if (_instance != null)
        {
            Destroy(gameObject);
            return;
        }

        _instance = this;
        DontDestroyOnLoad(gameObject);

        SceneManager.sceneLoaded += OnSceneLoaded;

        _content = Resources.Load <ContentDB>("ContentDB");
        Debug.Log("ContentDB was loaded");
    }
Esempio n. 14
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            int zoneID = ConvertUtility.ToInt32(dropZones.SelectedValue);

            AppEnv.ZoneSelected = zoneID;
            if (!isManager && !isDeployer)
            {
                dtgWaitingDeployList.DataSource = ContentDB.GetContentsByUserID(zoneID, (int)AppEnv.CMSWorkFlow.Waiting, CurrentAdminInfo.User_ID);
            }
            else
            {
                dtgWaitingDeployList.DataSource = ContentDB.GetContents(zoneID, (int)AppEnv.CMSWorkFlow.Waiting);
            }
            dtgWaitingDeployList.DataBind();
        }
Esempio n. 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zoneCurrent = ZoneUtility.GetZoneCurrent();

            //lnkZone.Text = ZoneDB.GetZoneNameByID(zoneCurrent);
            //lnkZone.NavigateUrl = ZoneUtility.BuildUrlByZoneCurrent(zoneCurrent);

            DataTable dtSpecial = DistributionDB.GetContentByZoneIDAndRank(_zoneCurrent, 1, (int)AppEnv.CMSContentRank.Special);

            if (dtSpecial.Rows.Count > 0)
            {
                int contentID = Convert.ToInt32(dtSpecial.Rows[0]["Content_ID"]);
                //litName.Text = dtSpecial.Rows[0]["Content_Name"].ToString();
                litContent.Text = ContentDB.GetInfo(contentID).Content_Body;
            }
        }
Esempio n. 16
0
        protected void dtgReturnList_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0)
            {
                return;
            }
            DataRowView rowData     = (DataRowView)e.Item.DataItem;
            HyperLink   lnkHeadline = (HyperLink)e.Item.FindControl("lnkHeadline");

            lnkHeadline.Text        = ContentDB.GetInfo(ConvertUtility.ToInt32(e.Item.Cells[0].Text)).Content_Name;
            lnkHeadline.NavigateUrl = AppEnv.ADMIN_CMD + "cmsviewcontent&contentid=" + e.Item.Cells[0].Text;
            lnkHeadline.ToolTip     = rowData["Content_Comment"].ToString();

            Button cmdDel = (Button)e.Item.FindControl("cmdDel");

            cmdDel.Attributes.Add("onclick", MiscUtility.DELETE_CONFIRM);
        }
Esempio n. 17
0
 public DirectoriesViewModel(DialogSession sessionMainDialogHost, string identifierDialogHost, ContentDB db, double widthColumnName, DataGridSelectionMode selectionMode)
 {
     _identifierDialogHost  = identifierDialogHost;
     _sessionMainDialogHost = sessionMainDialogHost;
     //SessionMainDialogHost?.UpdateContent(new SampleProgressDialog() { DataContext = new SampleProgressDialogViewModel(Settings.Same().LocalisationHelper["DMLRes.ConnectingDatabaseCaption"]) });
     HeaderControlHorizontalAlignment = HorizontalAlignment.Left;
     HeaderControlInit();
     SelectionChangedCommand = new DelegateCommand(SelectionChanged);
     MainWindowViewModel.LocalizationChangedEvent += new Action(SetColumNameCaption);
     // Init data
     _db = db;
     DataGridViewDepProp.Instance.WidthColumnName = widthColumnName;
     _tableName = typeof(T).Name + "s";
     _columnNameLocalizationIndex = GetColumnNameLocalizationIndex();
     SetColumNameCaption();
     Load();
     SelectionMode = selectionMode;
     SessionMainDialogHost?.Close(false);
 }
Esempio n. 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            contentInfo = ContentDB.GetInfo(ConvertUtility.ToInt32(Request.QueryString["contentid"]));
            if (contentInfo == null)
            {
                Response.Redirect(AppEnv.ADMIN_ACCESSDENY);
            }

            isManager  = RoleDB.CheckRole(CurrentAdminInfo.User_ID, (int)AppEnv.CMSRole.Manager);
            isDeployer = RoleDB.CheckRole(CurrentAdminInfo.User_ID, (int)AppEnv.CMSRole.Deployer);
            isCreater  = RoleDB.CheckRole(CurrentAdminInfo.User_ID, (int)AppEnv.CMSRole.Creater);

            lblStatusUpdate.Text = string.Empty;

            if (!IsPostBack)
            {
                LoadZones();
            }
        }
Esempio n. 19
0
        protected void dtgReturnList_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            try
            {
                int contentID = ConvertUtility.ToInt32(e.Item.Cells[0].Text);
                switch (e.CommandName)
                {
                case "deploy":
                {
                    if (isManager || isDeployer)
                    {
                        ContentDB.SetStatus(contentID, (int)AppEnv.CMSWorkFlow.Deploy);
                        DistributionInfo newDist = new DistributionInfo();
                        newDist.Distribution_ContentID = contentID;
                        newDist.Distribution_ZoneID    = ConvertUtility.ToInt32(dropZones.SelectedValue);
                        newDist.Distribution_Rank      = (int)AppEnv.CMSContentRank.Default;
                        DistributionDB.Insert(newDist);
                        lblStatusUpdate.Text = AppEnv.MSG_Deploy + dropZones.SelectedItem.Text;
                    }
                    else
                    if (isCreater)
                    {
                        ContentDB.SetStatus(contentID, (int)AppEnv.CMSWorkFlow.Waiting);
                        lblStatusUpdate.Text = AppEnv.MSG_Waiting + dropZones.SelectedItem.Text;
                    }
                    break;
                }

                case "delete":
                    ContentDB.Delete(contentID);
                    lblStatusUpdate.Text = MiscUtility.UPDATE_SUCCESS;
                    break;

                case "edit":
                    Response.Redirect(AppEnv.ADMIN_CMD + "cmseditcontent&contentid=" + contentID);
                    break;
                }
            }
            catch
            {
                lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
            }
        }
Esempio n. 20
0
        protected void dtgDeployList_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0)
            {
                return;
            }
            DataRowView rowData = (DataRowView)e.Item.DataItem;

            DropDownList dropContentRank = (DropDownList)e.Item.FindControl("dropContentRank");

            dropContentRank.Items.FindByValue(rowData["Distribution_Rank"].ToString()).Selected = true;

            DropDownList dropIndex = (DropDownList)e.Item.FindControl("dropIndex");

            MiscUtility.FillIndex(dropIndex, MAX_PRIORITY, ConvertUtility.ToInt32(rowData["Distribution_Priority"]));

            HyperLink lnkHeadline = (HyperLink)e.Item.FindControl("lnkHeadline");

            lnkHeadline.Text        = DistributionDB.GetNameByDistID(ConvertUtility.ToInt32(e.Item.Cells[0].Text));
            lnkHeadline.NavigateUrl = AppEnv.ADMIN_CMD + "cmsviewcontent&contentID=" + e.Item.Cells[1].Text;

            lnkHeadline.ToolTip = ContentDB.GetAuthorInfoByContentID(Convert.ToInt32(e.Item.Cells[1].Text));

            Button cmdRemove = (Button)e.Item.FindControl("cmdRemove");
            Button cmdDel    = (Button)e.Item.FindControl("cmdDel");
            Button cmdEdit   = (Button)e.Item.FindControl("cmdEdit");

            if (!isManager && !isDeployer)
            {
                cmdDel.Enabled          = false;
                cmdEdit.Enabled         = false;
                cmdRemove.Enabled       = false;
                dropContentRank.Enabled = false;
                dropIndex.Enabled       = false;
            }
            else
            {
                cmdRemove.Attributes.Add("onclick", MiscUtility.DELETE_CONFIRM);
                cmdDel.Attributes.Add("onclick", MiscUtility.DELETE_CONFIRM);
            }
        }
Esempio n. 21
0
        protected void dtgWaitingDeployList_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0)
            {
                return;
            }
            //DataRowView rowData = (DataRowView)e.Item.DataItem;
            HyperLink lnkHeadline = (HyperLink)e.Item.FindControl("lnkHeadline");
            int       contentid   = ConvertUtility.ToInt32(e.Item.Cells[0].Text);

            lnkHeadline.Text        = ContentDB.GetName(contentid);
            lnkHeadline.NavigateUrl = AppEnv.ADMIN_CMD + "cmsviewcontent&contentid=" + e.Item.Cells[0].Text;
            lnkHeadline.ToolTip     = ContentDB.GetAuthorInfoByContentID(contentid);
            Button cmdDeploy = (Button)e.Item.FindControl("cmdDeploy");
            Button cmdReturn = (Button)e.Item.FindControl("cmdReturn");

            if (!isManager && !isDeployer)
            {
                cmdDeploy.Enabled = false;
                cmdReturn.Enabled = false;
            }
        }
Esempio n. 22
0
 public CatalogViewModel(DialogSession sessionMainDialogHost, ContentDB db)
 {
     _sessionMainDialogHost = sessionMainDialogHost;
     HeaderControl          = new CatalogHeader()
     {
         DataContext = new CatalogHeaderViewModel(o => UpdCommandValidate(), o => DelCommandValidate())
     };
     HeaderControlHorizontalAlignment = HorizontalAlignment.Left;
     _headerViewModel = HeaderControl.DataContext as CatalogHeaderViewModel;
     // Subscriptions on events
     _headerViewModel.AddRootCommandEvent += () => AddRoot();
     _headerViewModel.AddCommandEvent     += () => Add();
     _headerViewModel.UpdCommandEvent     += () => Upd();
     _headerViewModel.DelCommandEvent     += () => Del();
     _headerViewModel.ReplaceCommandEvent += () => Replace();
     _headerViewModel.ConditionsEvent     += (o) => ImplementConditions(o);
     CatalogSelectedItemChangedCommand     = new DelegateCommand(CatalogSelectedItemChanged);
     // Init data
     _db           = db;
     SelectedIndex = -1;
     Load();
 }
Esempio n. 23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            contentid = ConvertUtility.ToInt32(Request.QueryString["productid"]);

            string returnurl = ConvertUtility.ToString(Request.QueryString["returnurl"]);

            if (!string.IsNullOrEmpty(returnurl))
            {
                lnkReturn.NavigateUrl = returnurl;
            }
            else
            {
                lnkReturn.NavigateUrl = "/";
            }

            CommonLibrary.CartShopping.Cart cart = null;

            object obj = Session["cart"];

            if (obj == null)
            {
                cart            = new CommonLibrary.CartShopping.Cart();
                Session["cart"] = cart;
            }
            else
            {
                cart = (CommonLibrary.CartShopping.Cart)obj;
            }
            var justLogged = ConvertUtility.ToInt32(Request.QueryString["jl"]);

            if (justLogged == 0)
            {
                if (!Page.IsPostBack)
                {
                    //ViewState["urlreference"] = Request.UrlReferrer.AbsoluteUri;
                    if (contentid > 0)
                    {
                        var name = ConvertUtility.ToString(ContentDB.GetName(contentid));

                        /****************** project
                         * var mdInfo = MydealItemDB.GetInfo(contentid);
                         *
                         * if (mdInfo != null)
                         * {
                         *  var item = new CartItem();
                         *  item.Name = name;
                         *  item.Price = Convert.ToSingle(mdInfo.Mydeal_Price);
                         *  item.ID = contentid;
                         *  item.Quantity = 1;
                         *  cart.Items.Add(item);
                         * }
                         *
                         */
                    }
                }
            }
            pnPayment.Visible = false;
            notice.Visible    = true;

            if (CookieUtility.GetCookie("Member_Email") != null)
            {
                if (MemberDB.GetIDByEmail(CookieUtility.GetCookie("Member_Email")) != 0)
                {
                    MemberInfo info = MemberDB.GetInfoByEmail(CookieUtility.GetCookie("Member_Email"));
                    if (info != null)
                    {
                        pnPayment.Visible = true;
                        notice.Visible    = false;

                        txtFullName.Text = info.Member_Fullname;
                        txtTel.Text      = info.Member_Tel;
                        txtAddress.Text  = info.Member_Address;
                        txtDistrict.Text = info.Member_District;
                        txtCity.Text     = info.Member_City;
                    }
                }
            }
        }
Esempio n. 24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _distInfo = DistributionDB.GetInfo(ConvertUtility.ToInt32(Request.QueryString["itemid"]));
            if (_distInfo == null)
            {
                Visible = false;
                return;
            }

            DistributionDB.UpdateView(_distInfo.Distribution_ID, 1);

            var contentInfo = ContentDB.GetInfo(_distInfo.Distribution_ContentID);

            litName.Text = contentInfo.Content_Name;

            if (_distInfo.Distribution_DisableTeaser)
            {
                pnTeaser.Visible = false;
            }
            else
            {
                if (contentInfo.Content_Teaser.Length > 0)
                {
                    litTeaser.Text = contentInfo.Content_Teaser;
                }
                else
                {
                    litTeaser.Visible = false;
                }

                if (_distInfo.Distribution_DisableAvatar)
                {
                    imgAvatar.Visible = false;
                }
                else
                {
                    var coverInfo = ImageDB.GetCover(ConvertUtility.ToInt32(contentInfo.Content_ID));
                    if (coverInfo != null)
                    {
                        string avatar = coverInfo.Image_File;
                        if (avatar.Length > 0)
                        {
                            imgAvatar.ImageUrl    = UrlFilter.BuildImageUrl(avatar, 150, 0);
                            lnkAvatar.NavigateUrl = MultimediaUtility.GetOriginalImage(avatar);

                            lnkAvatar.Attributes.Add("rel", "prettyPhoto");
                            lnkAvatar.ToolTip = coverInfo.Image_Description;
                        }
                        else
                        {
                            imgAvatar.Visible = false;
                        }
                    }
                    else
                    {
                        imgAvatar.Visible = false;
                    }
                }
            }



            litContent.Text = contentInfo.Content_Body;

            //litDatetime.Text = ConvertUtility.ToDateTime(distInfo.Distribution_CreateDate).ToString("dd/MM/yyyy");



            //DataTable dtNews = DistributionDB.GetNewsForCurrent(distInfo.Distribution_ID, 5);
            //if (dtNews.Rows.Count == 0)
            //{
            //    pnNew.Visible = false;
            //}
            //else
            //{
            //    rptNew.DataSource = dtNews;
            //    rptNew.DataBind();
            //}
        }
 public void Dispose()
 {
     TenantsDB?.Dispose();
     ContentDB?.Dispose();
 }
Esempio n. 26
0
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            contentInfo.Content_Name              = txtName.Text;
            contentInfo.Content_Teaser            = txtTeaser.Text;
            contentInfo.Content_Body              = Editor1.HtmlValue;
            contentInfo.Content_CreateDate        = ConvertUtility.ToDateTime(txtCreateDate.Text);
            contentInfo.Content_ModifiedDate      = DateTime.Now;
            contentInfo.Content_OriginalZoneID    = ConvertUtility.ToInt32(dropZones.SelectedValue);
            contentInfo.Content_ModifiedUserID    = CurrentAdminInfo.User_ID;
            contentInfo.Content_Author            = txtAuthor.Text;
            contentInfo.Content_EventDate         = ConvertUtility.ToDateTime(txtEventDate.Text);
            contentInfo.Content_FriendlyUrl       = UnicodeUtility.UnicodeToFriendlyUrl(txtName.Text);
            contentInfo.Content_ExcludeFromSearch = chkExcludeFromSearch.Checked;
            contentInfo.Content_IsPhoto           = chkIsPhoto.Checked;
            contentInfo.Content_IsDownload        = chkIsDownload.Checked;
            contentInfo.Content_IsVideo           = chkIsVideo.Checked;
            contentInfo.Content_IsPoll            = chkIsPoll.Checked;
            contentInfo.Content_IsProduct         = chkIsProduct.Checked;
            contentInfo.Content_Visible           = chkVisible.Checked;
            contentInfo.Content_IsTemp            = false;

            if (isManager || isDeployer)
            {
                //try
                //{
                contentInfo.Content_Status = (int)AppEnv.CMSWorkFlow.Deploy;
                ContentDB.Update(contentInfo);

                lblStatusUpdate.Text = AppEnv.MSG_Deploy + "<br /> ";
                lstZones.Items.FindByValue(dropZones.SelectedValue).Selected = true;
                foreach (ListItem item in lstZones.Items)
                {
                    if (item.Selected)
                    {
                        if (!DistributionDB.CheckContentExist(contentInfo.Content_ID, Convert.ToInt32(item.Value)))
                        {
                            //DistributionDB.RemoverInZoneID(contentInfo.Content_ID, Convert.ToInt32(item.Value));
                            int zoneID  = ConvertUtility.ToInt32(item.Value);
                            var newDist = new DistributionInfo();
                            newDist.Distribution_ContentID     = contentInfo.Content_ID;
                            newDist.Distribution_ZoneID        = zoneID;
                            newDist.Distribution_CreateDate    = DateTime.Now;
                            newDist.Distribution_Rank          = ConvertUtility.ToInt32(rdoContentRanks.SelectedValue);
                            newDist.Distribution_Layout        = dropLayout.SelectedValue;
                            newDist.Distribution_DisableTeaser = chkDisableTeaser.Checked;
                            newDist.Distribution_DisableAvatar = chkDisableAvatar.Checked;
                            DistributionDB.Insert(newDist);
                        }
                        lblStatusUpdate.Text += item.Text + ",<br>";
                    }
                    else
                    {
                        DistributionDB.RemoverInZoneID(contentInfo.Content_ID, Convert.ToInt32(item.Value));
                    }
                }



                lblStatusUpdate.Text  = lblStatusUpdate.Text.Substring(0, lblStatusUpdate.Text.Length - 5) + "</font>";
                lblStatusUpdate2.Text = MiscUtility.UPDATE_SUCCESS;
                //cmdHuy_Click(null, null);
                //}
                //catch
                //{
                //    lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
                //}
            }
            else
            {
                //try
                //{
                ContentDB.Update(contentInfo);

                lblStatusUpdate.Text = lblStatusUpdate2.Text = MiscUtility.UPDATE_SUCCESS;
                //}
                //catch
                //{
                //    lblStatusUpdate.Text = MiscUtility.UPDATE_ERROR;
                //}
            }
        }
Esempio n. 27
0
 public FoldersViewModel(DialogSession sessionMainDialogHost, string identifierDialogHost, ContentDB db, double widthColumnName, DataGridSelectionMode selectionMode)
     : base(sessionMainDialogHost, identifierDialogHost, db, widthColumnName, selectionMode)
 {
     MultimediaСontent = new Content()
     {
         DataContext = new ContentViewModel(ContentWorkMode.Folders)
     };
     _contentControlViewModel             = MultimediaСontent?.DataContext as ContentViewModel;
     HeaderViewModel.ContentControlHeader = ContentControlViewModel?.HeaderControl as ContentHeader;
 }
Esempio n. 28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _zoneCurrent = ZoneUtility.GetZoneCurrent();

            _itemid = ConvertUtility.ToInt32(Request.QueryString["itemid"]);

            _distInfo = DistributionDB.GetInfo(_itemid);
            if (_distInfo == null)
            {
                Visible = false;
                return;
            }

            DistributionDB.UpdateView(_distInfo.Distribution_ID, 1);

            _contentId = _distInfo.Distribution_ContentID;

            var contentInfo = ContentDB.GetInfo(_contentId);

            lnkName.Text        = contentInfo.Content_Name;
            lnkName.NavigateUrl = UrlFilter.BuildUrlByItemID(_itemid);



            lnkZone.Text        = ZoneDB.GetZoneNameByID(_zoneCurrent);
            lnkZone.NavigateUrl = UrlFilter.BuildUrlByZoneID(_zoneCurrent);

            var strSQL = "SELECT CMS_ContentImage.*, CMS_Images.* FROM CMS_ContentImage ";

            strSQL += " INNER JOIN CMS_Images ON CMS_ContentImage.Image_ID = CMS_Images.Image_ID ";
            strSQL += " WHERE 1=1 ";

            strSQL += " AND CMS_ContentImage.Content_ID=" + _contentId + " ";
            strSQL += " AND CMS_Images.Image_Visible=1 ";
            strSQL += " ORDER BY CMS_ContentImage.Priority ASC ";

            var source = DataHelper.GetDataFromTable(strSQL);

            if (source.Rows.Count > 0)
            {
                CollectionPager1.DataSource    = source.DefaultView;
                CollectionPager1.BindToControl = rptData;

                if (AppEnv.GetLanguageFrontEnd() == "vi-VN")
                {
                    CollectionPager1.LabelText = "Trang:&nbsp;";
                }
                else
                {
                    CollectionPager1.LabelText = "Page:&nbsp;";
                }

                CollectionPager1.BackText              = "<<";
                CollectionPager1.PageNumbersSeparator  = "&nbsp;&nbsp;&nbsp;";
                CollectionPager1.BackNextLinkSeparator = "&nbsp;&nbsp;&nbsp;";

                rptData.DataSource = CollectionPager1.DataSourcePaged;
                rptData.DataBind();
            }
            else
            {
                rptData.Visible = false;
            }
        }
Esempio n. 29
0
        protected void butSubmit_Click(object sender, EventArgs e)
        {
            if (chkAgree.Checked)
            {
                var fullname  = HTMLUtility.SecureHTML(txtFullName.Text.Trim());
                var tel       = HTMLUtility.SecureHTML(txtTel.Text.Trim());
                var address   = HTMLUtility.SecureHTML(txtAddress.Text.Trim());
                var district  = HTMLUtility.SecureHTML(txtDistrict.Text.Trim());
                var city      = HTMLUtility.SecureHTML(txtCity.Text.Trim());
                var note      = HTMLUtility.SecureHTML(txtNote.Text.Trim());
                var orderdate = DateTime.Now;


                if (fullname.Length == 0 || tel.Length == 0 || address.Length == 0 || district.Length == 0 || city.Length == 0)
                {
                    MessageBox.Show("Bạn phải điền đủ các trường (*)");
                    return;
                }



                var cart = (CommonLibrary.CartShopping.Cart)Session["cart"];

                string email = CookieUtility.GetCookie("Member_Email");

                var totalprice = cart.TotalPrice;

                var memberInfo = MemberDB.GetInfoByEmail(email);
                if (memberInfo.Member_Fullname.Length == 0)
                {
                    memberInfo.Member_Fullname = fullname;
                }
                if (memberInfo.Member_Tel.Length == 0)
                {
                    memberInfo.Member_Tel = tel;
                }
                if (memberInfo.Member_Address.Length == 0)
                {
                    memberInfo.Member_Address = address;
                }
                if (memberInfo.Member_District.Length == 0)
                {
                    memberInfo.Member_District = district;
                }
                if (memberInfo.Member_City.Length == 0)
                {
                    memberInfo.Member_City = city;
                }

                MemberDB.Update(memberInfo);

                var info = new OrderInfo();

                info.Member_ID        = MemberDB.GetIDByEmail(email);
                info.Order_Fullname   = fullname;
                info.Order_Email      = email;
                info.Order_Tel        = tel;
                info.Order_Address    = address;
                info.Order_District   = district;
                info.Order_City       = city;
                info.Order_Note       = note;
                info.Order_CreateDate = orderdate;
                info.Order_Status     = 0;
                info.Order_Price      = ConvertUtility.ToDouble(totalprice);
                info.Order_Quantity   = ConvertUtility.ToInt32(cart.Items.Count);

                var orderid = OrderDB.Insert(info);

                var sbProducts = new StringBuilder();

                sbProducts.Append("<tr>");

                foreach (DataGridItem item in dtgProduct.Items)
                {
                    var id       = ConvertUtility.ToInt32(item.Cells[0].Text);
                    var quantity = ConvertUtility.ToInt32(item.Cells[1].Text);
                    var price    = ConvertUtility.ToInt32(item.Cells[2].Text);
                    var sum      = price * quantity;
                    var oinfo    = new OrderProductInfo();


                    oinfo.Order_ID   = orderid;
                    oinfo.Content_ID = id;
                    oinfo.Quantity   = quantity;
                    oinfo.Price      = price;
                    oinfo.PriceSum   = sum;

                    OrderProductDB.Insert(oinfo);

                    sbProducts.Append("<td style=\"padding: 4px; border: 1px #b1d1e6 solid; text-align: center;\">" + item.ItemIndex + 1 + "</td>");
                    sbProducts.Append("<td style=\"padding: 4px; border: 1px #b1d1e6 solid;\">" + ContentDB.GetName(id) + "</td>");
                    sbProducts.Append("<td style=\"padding: 4px; border: 1px #b1d1e6 solid; text-align: center;\">" + quantity + "</td>");
                    sbProducts.Append("<td style=\"padding: 4px; border: 1px #b1d1e6 solid; text-align: center;\">" + string.Format("{0:0,0}", price) + "</td>");
                    sbProducts.Append("<td style=\"padding: 4px; border: 1px #b1d1e6 solid; text-align: center;\">" + string.Format("{0:0,0}", sum) + "</td>");
                }

                sbProducts.Append("</tr>");

                string emailadd = AppEnv.ContactEmail;

                var sb = new StringBuilder();
                sb.Append("Ban co don dat hang #" + orderid + " tu My-Deal.vn:");
                sb.Append("<br><br><b>Ten</b>: ");
                sb.Append(fullname);
                sb.Append("<br><b>Email</b>: ");
                sb.Append(email);
                sb.Append("<br><b>Dien thoai</b>: ");
                sb.Append(tel);
                sb.Append("<br><b>Dia chi</b>: ");
                sb.Append(txtAddress.Text);
                sb.Append("<br><b>Noi dung</b>:<br>");
                sb.Append(txtNote.Text);
                sb.Append("<br><br>-----------------------------<br>De biet thong tin chi tiet don hang, hay dang nhang vao website<br>");

                // new email solution start

                MailMessage emailmess = new MailMessage(email, emailadd);
                emailmess.Subject    = "Don dat hang cua khach hang tu website";
                emailmess.IsBodyHtml = true;
                emailmess.Body       = sb.ToString();

                SmtpClient smtp = new SmtpClient();

                if (AppEnv.MailServer.Length == 0)
                {
                    smtp.Host = "localhost";
                }
                else
                {
                    smtp.Host = AppEnv.MailServer;
                }

                if (AppEnv.MailServerPort.Length == 0)
                {
                    smtp.Port = 25;
                }
                else
                {
                    smtp.Port = ConvertUtility.ToInt32(AppEnv.MailServerPort);
                }

                // if authentication
                if (AppEnv.MailUsername.Length > 0 && AppEnv.MailPassword.Length > 0)
                {
                    smtp.Credentials    = new NetworkCredential(AppEnv.MailUsername, AppEnv.MailPassword);
                    smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
                }
                // if authentication end

                // gui cho khach hang thong tin deal

                var emailForCusContent = "";

                //try
                //{
                const string templateUrl = "/templates/deal_confirm.htm";
                var          htmlpage    = GetHtmlPage(templateUrl);
                if (htmlpage != "NULL")
                {
                    emailForCusContent = htmlpage;
                }
                //}
                //catch
                //{
                //    ErrorReportDB.NewReport(Request.RawUrl, "Thong tin CK HOSE:" + DateTime.Now);
                //}

                emailForCusContent = emailForCusContent.Replace("[[order_id]]", orderid.ToString()).Replace("[[order_datetime]]", orderdate.ToString("dd/MM/yyyy HH:mm")).Replace("[[order_note]]", note).Replace("[[order_products]]", sbProducts.ToString()).Replace("[[order_pricesum]]", string.Format("{0:0,0}", totalprice) + " VNĐ").Replace("[[order_fullname]]", fullname).Replace("[[order_address]]", address).Replace("[[order_tel]]", tel);

                // new email solution start
                var emailmess2 = new MailMessage(emailadd, email);
                emailmess2.Subject    = "[My-deal.vn] Thong tin dat hang #" + orderid;
                emailmess2.IsBodyHtml = true;
                emailmess2.Body       = emailForCusContent;

                var smtp2 = new SmtpClient();

                if (AppEnv.MailServer.Length == 0)
                {
                    smtp2.Host = "localhost";
                }
                else
                {
                    smtp2.Host = AppEnv.MailServer;
                }

                if (AppEnv.MailServerPort.Length == 0)
                {
                    smtp2.Port = 25;
                }
                else
                {
                    smtp2.Port = ConvertUtility.ToInt32(AppEnv.MailServerPort);
                }

                // if authentication
                if (AppEnv.MailUsername.Length > 0 && AppEnv.MailPassword.Length > 0)
                {
                    smtp2.Credentials    = new NetworkCredential(AppEnv.MailUsername, AppEnv.MailPassword);
                    smtp2.DeliveryMethod = SmtpDeliveryMethod.Network;
                }
                // if authentication end

                try
                {
                    smtp.Send(emailmess);

                    smtp2.Send(emailmess2);
                    notice.InnerHtml = "<br><br><br><font color=black><b>Đơn đặt hàng của bạn đã được gửi tới " + emailadd + ".Chúng tôi sẽ liên hệ với bạn trong thời gian ngắn nhất<br /><br />Xin chân thành cảm ơn!</b></font>";
                }
                catch (Exception z)
                {
                    notice.InnerHtml =
                        "<br><br><br><font color=black><b>Đơn đặt hàng của bạn đã được gửi đi..Chúng tôi sẽ liên hệ với bạn trong thời gian ngắn nhất<br /><br />Xin chân thành cảm ơn!</b></font><br>";
                }
                finally
                {
                    pnPayment.Visible = false;
                    notice.Visible    = true;
                    SessionUtility.Remove("cart");
                }
            }
            else
            {
                MessageBox.Show("Bạn cần phải đồng ý với điều khoản của My-Deal.vn");
            }
        }