Esempio n. 1
0
 void UpdateOrder()
 {
     string[] fieldsDelGroup = { "IGORDER" };
     string[] valuesDelGroup = { igorder };
     condition = DataExtension.AndConditon(GroupsTSql.GetGroupsByIgid(igid));
     Groups.UpdateGroupsCondition(DataExtension.UpdateTransfer(fieldsDelGroup, valuesDelGroup), condition);
 }
Esempio n. 2
0
 private void EditValue(string iLanguageKeyId)
 {
     //Nếu key language chưa có giá trị
     if (SetCountItem(iLanguageKeyId).Equals("0"))
     {
         for (int i = 0; i <= RpListLanguageNationals.Items.Count - 1; i++)
         {
             TextBox tbTitle = (TextBox)RpListLanguageNationals.Items[i].FindControl(("TbLanguageWord"));
             string  value   = tbTitle.Text.Replace("'", "''");
             if (tbTitle.ToolTip.Equals(iLanguageKeyId))
             {
                 LanguageItem.InsertLanguageItem(language, iLanguageKeyId, value, "", "");
             }
         }
     }
     else //Nếu key language có giá trị rồi
     {
         for (int i = 0; i <= RpListLanguageNationals.Items.Count - 1; i++)
         {
             TextBox tbTitle = (TextBox)RpListLanguageNationals.Items[i].FindControl(("TbLanguageWord"));
             string  value   = tbTitle.Text.Replace("'", "''");
             if (tbTitle.ToolTip.Equals(iLanguageKeyId))
             {
                 string[] fields    = { "nLanguageItemTitle" };
                 string[] values    = { "N'" + value + "'" };
                 string   condition = DataExtension.AndConditon(LanguageItemTSql.GetByiLanguageKeyId(iLanguageKeyId),
                                                                LanguageItemTSql.GetByiLanguageNationalId(language));
                 LanguageItem.UpdateLanguageItem(DataExtension.UpdateTransfer(fields, values), condition);
             }
         }
     }
 }
    //Loại bỏ thuộc tính ra khỏi danh mục
    protected void btRemove_Click(object sender, EventArgs e)
    {
        string listFilterProperties = GetListFilterProperties();

        int[] iidArry = lstbAdded.GetSelectedIndices();
        if (iidArry.Length > 0)
        {
            for (int i = 0; i < iidArry.Length; i++)
            {
                listFilterProperties = listFilterProperties.Replace(parramSplitString + lstbAdded.Items[iidArry[i]].Value + parramSplitString, parramSplitString);
            }
            //Cap nhat lai danh sach thuoc tinh
            string[] fieldsEditStatus = { TatThanhJsc.Columns.GroupsColumns.VgparamsColumn };
            string[] valuesEditStatus = { "'" + listFilterProperties + "'" };
            if (cbApplyToSubCategory.Checked == true)
            {
                TatThanhJsc.Database.Groups.UpdateGroupsCondition(DataExtension.UpdateTransfer(fieldsEditStatus, valuesEditStatus), "charindex(','+cast(" + igid + " as varchar(10))+','," + TatThanhJsc.Columns.GroupsColumns.IgparentsidColumn + ") >0");
            }
            else
            {
                TatThanhJsc.Database.Groups.UpdateGroupsCondition(DataExtension.UpdateTransfer(fieldsEditStatus, valuesEditStatus), TatThanhJsc.TSql.GroupsTSql.GetGroupsByIgid(igid));
            }

            //Lấy lại danh sách các thuộc tính
            GetListAdded();
            GetListNotAdded();
        }
    }
    protected void RpListMembers_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string c = e.CommandName.Trim();
        string p = e.CommandArgument.ToString().Trim();

        top       = "";
        fields    = "*";
        condition = MembersTSql.GetMembersByImid(p);
        order     = "";
        DataTable dt = new DataTable();

        dt = Members.GetMembersCondition(top, fields, condition, order);
        switch (c)
        {
            #region Delete
        case "delete":
            Members.DeleteMembersByIMID(p);
            GetListMembers();

            #region Logs
            string logAuthor     = CookieExtension.GetCookies("LoginSetting");
            string logCreateDate = DateTime.Now.ToString();
            Logs.InsertLogs(logCreateDate, Request.Url.ToString(), "", dt.Rows[0][MembersColumns.vMemberAccount].ToString(), logAuthor, "", logCreateDate + ": " + logAuthor + " xóa thành viên " + dt.Rows[0][MembersColumns.vMemberAccount].ToString());
            #endregion
            break;

            #endregion
            #region Edit Status
        case "lock":
            string[] fieldsEditStatus = { "iMemberIsLockedOut" };
            string[] valuesEditStatus = { "" };
            if (dt.Rows[0]["iMemberIsLockedOut"].ToString().Equals("0"))
            {
                valuesEditStatus[0] = "1";
                Members.UpdateMembersCondition(DataExtension.UpdateTransfer(fieldsEditStatus, valuesEditStatus), condition);
            }
            else
            {
                valuesEditStatus[0] = "0";
                Members.UpdateMembersCondition(DataExtension.UpdateTransfer(fieldsEditStatus, valuesEditStatus), condition);
            }
            GetListMembers();

            #region Logs
            logAuthor     = CookieExtension.GetCookies("LoginSetting");
            logCreateDate = DateTime.Now.ToString();
            Logs.InsertLogs(logCreateDate, Request.Url.ToString(), "", dt.Rows[0][MembersColumns.vMemberAccount].ToString(), logAuthor, "", logCreateDate + ": " + logAuthor + " cập nhật trạng thái thành viên " + dt.Rows[0][MembersColumns.vMemberAccount].ToString());
            #endregion
            break;

            #endregion
            #region edit
        case "edit":
            Response.Redirect(LinkAdmin.GoAdminItem(CodeApplications.Member, TypePage.UpdateItem, p));
            break;
            #endregion
        }
    }
    protected void LbDelFlagCurrent_Click(object sender, EventArgs e)
    {
        string[] fields    = { "nLanguageNationalFlag" };
        string[] values    = { "''" };
        string   condition = LanguageNationalTSql.GetByiLanguageNationalId(iLanguageNationalId);

        LanguageNational.UpdateLanguageNational(DataExtension.UpdateTransfer(fields, values), condition);
        ImagesExtension.DeleteImageWhenDeleteItem(pic, HdFlagNational.Value);
    }
 protected void TextChanged(object sender, EventArgs e)
 {
     TextBox textbox = sender as TextBox;
     string[] fields = { "IORDER" };
     string[] values = { textbox.Text };
     string condition = " IGIID = '" + textbox.ToolTip + "' ";
     GroupsItems.UpdateGroupsItemsCondition(DataExtension.UpdateTransfer(fields, values), condition);
     GetQA("");
 }
Esempio n. 7
0
    protected void rp_mn_users_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string c = e.CommandName.Trim();
        string p = e.CommandArgument.ToString().Trim();

        fields    = "*";
        condition = ItemsTSql.GetItemsCondition(p, app);
        DataTable dt = new DataTable();

        dt = GroupsItems.GetAllData(top, fields, condition, orderBy);
        switch (c)
        {
            #region Delete
        case "delete":
            TatThanhJsc.Database.Items.DeleteItems(ItemsTSql.GetItemsByIid(p));
            break;

            #endregion
            #region Edit Enable
        case "EditEnable":
            string[] fieldsEnable = { "IIENABLE" };
            string[] valuesEnable = { "" };
            if (dt.Rows[0]["IIENABLE"].ToString().Equals("0"))
            {
                valuesEnable[0] = "1";
                TatThanhJsc.Database.Items.UpdateItems(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            else
            {
                valuesEnable[0] = "0";
                TatThanhJsc.Database.Items.UpdateItems(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            GetVotes();
            break;

            #endregion
            #region Edit
        case "edit":
            pnList.Visible       = false;
            pnShorcut.Visible    = true;
            hdInsertUpdate.Value = "update";
            HdId.Value           = dt.Rows[0]["IID"].ToString();
            TbRep.Text           = dt.Rows[0]["VITITLE"].ToString();
            if (dt.Rows[0]["IIENABLE"].ToString().Equals("1"))
            {
                cbEnable.Checked = true;
            }
            else
            {
                cbEnable.Checked = false;
            }

            break;
            #endregion
        }
    }
Esempio n. 8
0
    protected void TextChanged(object sender, EventArgs e)
    {
        TextBox textbox = sender as TextBox;

        string[] fields    = { "nLanguageNationalDesc" };
        string[] values    = { textbox.Text };
        string   condition = LanguageNationalTSql.GetByiLanguageNationalId(textbox.ToolTip);

        LanguageNational.UpdateLanguageNational(DataExtension.UpdateTransfer(fields, values), condition);
        GetListLanguageNationals();
    }
    protected void UpdateTitle(object sender, EventArgs e)
    {
        TextBox textbox = sender as TextBox;

        string[] fields    = { ItemsColumns.VititleColumn };
        string[] values    = { "N'" + textbox.Text + "'" };
        string   condition = ItemsTSql.GetItemsByIid(textbox.ToolTip);

        TatThanhJsc.Database.Items.UpdateItems(DataExtension.UpdateTransfer(fields, values), condition);
        //GetListWebsites("");
    }
    protected void UpdateTitle(object sender, EventArgs e)
    {
        TextBox textbox = sender as TextBox;

        string[] fields    = { SubitemsColumns.VstitleColumn };
        string[] values    = { "N'" + textbox.Text + "'" };
        string   condition = SubitemsTSql.GetSubitemsByIsid(textbox.ToolTip);

        Subitems.UpdateSubitems(DataExtension.UpdateTransfer(fields, values), condition);
        //GetListDeals("");
    }
Esempio n. 11
0
    void RestoreItem()
    {
        string[] fieldsDelGroup = { "IIENABLE" };
        string[] valuesDelGroup = { "1" };
        condition = " IID = '" + iid + "' ";
        TatThanhJsc.Database.Items.UpdateItems(DataExtension.UpdateTransfer(fieldsDelGroup, valuesDelGroup), condition);

        #region Logs
        string logAuthor     = CookieExtension.GetCookies("LoginSetting");
        string logCreateDate = DateTime.Now.ToString();
        string title         = GetTitle(iid);
        Logs.InsertLogs(logCreateDate, Request.Url.ToString(), "", title, logAuthor, "", logCreateDate + ": " + logAuthor + " khôi phục " + title + " (id: " + iid + ")");
        #endregion
    }
Esempio n. 12
0
    void RestoreCate()
    {
        string[] fieldsDelGroup = { "IGENABLE", GroupsColumns.DgupdateColumn };
        string[] valuesDelGroup = { "1", "'" + DateTime.Now.ToString() + "'" };
        condition = " CHARINDEX('," + igid + ",',IGPARENTSID) > 0 ";
        Groups.UpdateGroupsCondition(DataExtension.UpdateTransfer(fieldsDelGroup, valuesDelGroup), condition);

        #region Logs
        string logAuthor     = CookieExtension.GetCookies("LoginSetting");
        string logCreateDate = DateTime.Now.ToString();
        string title         = GetTitle(igid);
        Logs.InsertLogs(logCreateDate, Request.Url.ToString(), "", title, logAuthor, "", logCreateDate + ": " + logAuthor + " khôi phục " + title + " (id: " + igid + ")");
        #endregion
    }
    protected void rp_mn_users_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string c = e.CommandName.Trim();
        string p = e.CommandArgument.ToString().Trim();

        fields    = "*";
        condition = ItemsTSql.GetItemsCondition(p, app);

        switch (c)
        {
            #region Delete
        case "delete":
            string[] fieldsDelItem = { "IIENABLE", ItemsColumns.DiupdateColumn };
            string[] valuesDelItem = { "2", "'" + DateTime.Now.ToString() + "'" };

            Items.UpdateItems(DataExtension.UpdateTransfer(fieldsDelItem, valuesDelItem), condition);
            GetService("");
            break;

            #endregion
            #region Edit Enable
        case "EditEnable":
            DataTable dt = new DataTable();
            dt = GroupsItems.GetAllData(top, fields, condition, orderBy);

            string[] fieldsEnable = { "IIENABLE" };
            string[] valuesEnable = { "" };
            if (dt.Rows[0]["IIENABLE"].ToString().Equals("0"))
            {
                valuesEnable[0] = "1";
                Items.UpdateItems(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            else
            {
                valuesEnable[0] = "0";
                Items.UpdateItems(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            GetService("");
            break;

            #endregion
            #region Edit
        case "edit":
            Response.Redirect(LinkUpdate(p));
            break;
            #endregion
        }
    }
Esempio n. 14
0
    protected void btOKChangeInfo_Click(object sender, EventArgs e)
    {
        string userId    = CookieExtension.GetCookies("UserId");
        string condition = UsersTSql.GetUsersByUserid(userId);

        string[] fields = { UsersColumns.UserfirstnameColumn, UsersColumns.UserlastnameColumn, UsersColumns.UseraddressColumn, UsersColumns.UserphonenumberColumn, UsersColumns.UseridentitycardColumn };
        string[] value  = { "N'" + tbHo.Text + "'", "N'" + tbTen.Text + "'", "N'" + tbDiaChi.Text + "'", "N'" + tbDienThoai.Text + "'", "N'" + tbSoCMND.Text + "'" };

        Users.UpdateUsers(DataExtension.UpdateTransfer(fields, value), condition);

        ScriptManager.RegisterStartupScript(this, this.GetType(), "", "ThongBao(3000,'Cập nhật thông tin thành công');", true);

        pnChangeInfo.Visible = false;
        pnInfo.Visible       = true;
        GetInfoUser();
    }
    protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string c = e.CommandName.Trim();
        string p = e.CommandArgument.ToString().Trim();

        fields    = "*";
        condition = SubitemsTSql.GetSubitemsByIsid(p);
        DataTable dt = new DataTable();

        dt = Subitems.GetSubItems("", "*", condition, "");
        switch (c)
        {
            #region Delete
        case "delete":
            ImagesExtension.DeleteImageWhenDeleteItem(pathFolderPic, dt.Rows[0][SubitemsColumns.VsimageColumn].ToString());
            Subitems.DeleteSubitems(p);
            GetList();
            break;

            #endregion
            #region Edit Enable
        case "EditEnable":
            string[] fieldsEnable = { SubitemsColumns.IsenableColumn };
            string[] valuesEnable = { "" };
            if (dt.Rows[0][SubitemsColumns.IsenableColumn].ToString().Equals("0"))
            {
                valuesEnable[0] = "1";
                Subitems.UpdateSubitems(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            else
            {
                valuesEnable[0] = "0";
                Subitems.UpdateSubitems(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            GetList();
            break;

            #endregion
            #region Edit
        case "edit":
            //OpenUpdatePanel(p);
            Response.Redirect(UrlExtension.WebisteUrl + "cms/admin/Moduls/Deal/Item/PopUp/AddVideoToItems.aspx?iid=" + iid + "&isid=" + p);
            break;
            #endregion
        }
    }
Esempio n. 16
0
    void UpdateEnable()
    {
        string valueUpdate = "";

        if (isenable.Equals("0"))
        {
            valueUpdate = "1";
        }
        else
        {
            valueUpdate = "0";
        }
        string[] fieldsDelGroup = { "ISENABLE" };
        string[] valuesDelGroup = { valueUpdate };
        condition = " ISID = '" + isid + "' ";
        Subitems.UpdateSubitems(DataExtension.UpdateTransfer(fieldsDelGroup, valuesDelGroup), condition);
    }
    protected void rp_mn_users_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string c = e.CommandName.Trim();
        string p = e.CommandArgument.ToString().Trim();

        fields = "*";
        DataTable dt = new DataTable();

        dt = Members.GetMembersCondition("", MembersColumns.ImemberisapprovedColumn, MembersTSql.GetMembersByImid(p), "");

        switch (c)
        {
            #region Delete
        case "delete":
            Members.DeleteMembersByIMID(p);
            GetCategories("");
            break;

            #endregion
            #region Edit Status
        case "EditStatus":
            string[] fieldsEditStatus = { "iMemberIsLockedOut" };
            string[] valuesEditStatus = { "" };
            if (dt.Rows[0]["iMemberIsLockedOut"].ToString().Equals("0"))
            {
                valuesEditStatus[0] = "1";
                Members.UpdateMembersCondition(DataExtension.UpdateTransfer(fieldsEditStatus, valuesEditStatus), condition);
            }
            else
            {
                valuesEditStatus[0] = "0";
                Members.UpdateMembersCondition(DataExtension.UpdateTransfer(fieldsEditStatus, valuesEditStatus), condition);
            }
            GetCategories("");

            break;

            #endregion
            #region edit
        case "editPassword":
            Response.Redirect(LinkAdmin.GoAdminItem(CodeApplications.Member, TypePage.UpdateItem, p));
            break;
            #endregion
        }
    }
Esempio n. 18
0
    void DeleteListItem()
    {
        string[] arrigid = listigid.Split(Convert.ToChar(","));
        for (int i = 0; i < arrigid.Length - 1; i++)
        {
            string[] fieldsDelGroup = { "IIENABLE" };
            string[] valuesDelGroup = { "2" };
            condition = " IID = '" + arrigid[i] + "' ";
            TatThanhJsc.Database.Items.UpdateItems(DataExtension.UpdateTransfer(fieldsDelGroup, valuesDelGroup), condition);

            #region Logs
            string logAuthor     = CookieExtension.GetCookies("LoginSetting");
            string logCreateDate = DateTime.Now.ToString();
            string title         = GetTitle(arrigid[i]);
            Logs.InsertLogs(logCreateDate, Request.Url.ToString(), "", title, logAuthor, "", logCreateDate + ": " + logAuthor + " xóa " + title + " (id: " + arrigid[i] + ")");
            #endregion
        }
    }
    protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string c = e.CommandName.Trim();
        string p = e.CommandArgument.ToString().Trim();

        fields    = "*";
        condition = GroupsTSql.GetGroupsByIgid(p);
        DataTable dt = new DataTable();

        dt = Groups.GetGroups("", fields, condition, "");
        switch (c)
        {
            #region Delete
        case "delete":
            DeleteDealFields(p);
            GetList();
            break;

            #endregion
            #region Edit Enable
        case "EditEnable":
            string[] fieldsEnable = { GroupsColumns.IgenableColumn };
            string[] valuesEnable = { "" };
            if (dt.Rows[0][GroupsColumns.IgenableColumn].ToString().Equals("0"))
            {
                valuesEnable[0] = "1";
                Groups.UpdateGroupsCondition(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            else
            {
                valuesEnable[0] = "0";
                Groups.UpdateGroupsCondition(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            GetList();
            break;

            #endregion
            #region Edit
        case "edit":
            OpenUpdatePanel(p);
            break;
            #endregion
        }
    }
Esempio n. 20
0
    protected void TextChanged(object sender, EventArgs e)
    {
        TextBox textbox = sender as TextBox;

        if (SetCountItem(textbox.ToolTip).Equals("0")) //Nếu key language chưa có giá trị, insert mới
        {
            string value = textbox.Text.Replace("'", "''");
            LanguageItem.InsertLanguageItem(language, textbox.ToolTip, value, "", "");
        }
        else//Nếu key language có giá trị rồi, update
        {
            string   value     = textbox.Text.Replace("'", "''");
            string[] fields    = { "nLanguageItemTitle" };
            string[] values    = { "N'" + value + "'" };
            string   condition = DataExtension.AndConditon(LanguageItemTSql.GetByiLanguageKeyId(textbox.ToolTip),
                                                           LanguageItemTSql.GetByiLanguageNationalId(language));
            LanguageItem.UpdateLanguageItem(DataExtension.UpdateTransfer(fields, values), condition);
        }
    }
Esempio n. 21
0
    protected void btOK_Click(object sender, EventArgs e)
    {
        #region Image
        string vimg = "";
        if (flimg.FileName.Length > 0 && flimg.PostedFile.ContentLength > 0)
        {
            string filename = "";
            filename = System.IO.Path.GetFileName(flimg.PostedFile.FileName);
            string fileex = "";

            fileex = System.IO.Path.GetExtension(filename).ToLower();
            if (fileex == ".jpg" || fileex == ".jpeg" || fileex == ".gif" || fileex == ".png" || fileex == ".bmp" || fileex == ".JPG" || fileex == ".JPEG" || fileex == ".GIF" || fileex == ".PNG" || fileex == ".BMP")
            {
                string fileNotEx = System.IO.Path.GetFileNameWithoutExtension(flimg.PostedFile.FileName);
                vimg = StringExtension.ReplateTitle(fileNotEx) + DateTime.Now.Ticks.ToString() + fileex;
                flimg.SaveAs(Request.PhysicalApplicationPath + "/" + folderpic + "/" + vimg);
            }
        }
        #endregion
        if (hdUpdate.Value == "1")//Cập nhật
        {
            if (vimg.Length > 0)
            {
                string[] fields    = { TatThanhJsc.Columns.LanguageItemColumns.nLanguageItemParams };
                string[] values    = { "N'" + vimg + "'" };
                string   condition = DataExtension.AndConditon(LanguageItemTSql.GetByiLanguageKeyId(iLanguageKeyId),
                                                               LanguageItemTSql.GetByiLanguageNationalId(language));
                LanguageItem.UpdateLanguageItem(DataExtension.UpdateTransfer(fields, values), condition);
                //Xoá ảnh cũ
                ImagesExtension.DeleteImageWhenDeleteItem(folderpic, hdOldImage.Value);
            }
            else
            {
                vimg = hdOldImage.Value;
            }
        }
        else//Thêm mới
        {
            LanguageItem.InsertLanguageItem(language, iLanguageKeyId, "", "", vimg);
        }
        ScriptManager.RegisterStartupScript(this, this.GetType(), "", "alert('Cập nhật thành công');ChangeImage('img" + iLanguageKeyId + "','" + UrlExtension.WebisteUrl + folderpic + "/" + vimg + "');window.close();", true);
    }
Esempio n. 22
0
    void DeleteCate()
    {
        string[] arrigid = listigid.Split(Convert.ToChar(","));


        for (int i = 0; i < arrigid.Length - 1; i++)
        {
            string[] fieldsDelGroup = { "IGENABLE", GroupsColumns.DgupdateColumn };
            string[] valuesDelGroup = { "2", "'" + DateTime.Now.ToString() + "'" };
            condition = " CHARINDEX('," + arrigid[i] + ",',IGPARENTSID) > 0 ";
            Groups.UpdateGroupsCondition(DataExtension.UpdateTransfer(fieldsDelGroup, valuesDelGroup), condition);


            #region Logs
            string logAuthor     = CookieExtension.GetCookies("LoginSetting");
            string logCreateDate = DateTime.Now.ToString();
            string title         = GetTitle(arrigid[i]);
            Logs.InsertLogs(logCreateDate, Request.Url.ToString(), "", title, logAuthor, "", logCreateDate + ": " + logAuthor + " xóa " + title + " (id: " + arrigid[i] + ")");
            #endregion
        }
    }
    protected void lnk_delete_user_checked_Click(object sender, EventArgs e)
    {
        for (int i = 0; i <= rp_mn_users.Items.Count - 1; i++)
        {
            CheckBox chkDelete = (CheckBox)rp_mn_users.Items[i].FindControl(("chk_item"));
            if (chkDelete != null)
            {
                if (chkDelete.Checked)
                {
                    ArrayId += chkDelete.ToolTip;
                    ArrayId += ",";
                }
            }
            else
            {
                return;
            }
        }
        if (ArrayId.Length > 0)
        {
            ArrayId = ArrayId.Substring(0, (ArrayId.Length - 1));
        }
        else
        {
            return;
        }
        //condition = " IID in(" + ArrayId + ") ";
        //Đoàn sửa
        char[] splitItem = { ',' };
        foreach (string itemID in ArrayId.Split(splitItem, StringSplitOptions.RemoveEmptyEntries))
        {
            string[] fieldsDelItem = { "IIENABLE", ItemsColumns.DiupdateColumn };
            string[] valuesDelItem = { "2", "'" + DateTime.Now.ToString() + "'" };
            Items.UpdateItems(DataExtension.UpdateTransfer(fieldsDelItem, valuesDelItem), ItemsTSql.GetItemsByIid(itemID));
        }

        GetService("");
    }
    protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string c = e.CommandName.Trim();
        string p = e.CommandArgument.ToString().Trim();

        fields    = "*";
        condition = SubitemsTSql.GetSubitemsByIsid(p);

        switch (c)
        {
            #region Delete
        case "delete":
            DeleteComment(p);
            GetListComments();
            break;

            #endregion
            #region Edit Enable
        case "EditEnable":
            DataTable dt = new DataTable();
            dt = Subitems.GetSubItems("", SubitemsColumns.IsenableColumn, condition, "");
            string[] fieldsEnable = { SubitemsColumns.IsenableColumn };
            string[] valuesEnable = { "" };
            if (dt.Rows[0][SubitemsColumns.IsenableColumn].ToString().Equals("0"))
            {
                valuesEnable[0] = "1";
                Subitems.UpdateSubitems(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            else
            {
                valuesEnable[0] = "0";
                Subitems.UpdateSubitems(DataExtension.UpdateTransfer(fieldsEnable, valuesEnable), condition);
            }
            GetListComments();
            break;
            #endregion
        }
    }
Esempio n. 25
0
    void Session_Start(object sender, EventArgs e)
    {
        //Code that runs when a new session is started
        DataTable dt = new DataTable();

        dt = Settings.GetSettingsCondition("", "*",
                                           DataExtension.AndConditon(
                                               SettingsTSql.GetSettingsByVskey(SettingsExtension.KeyTotalView),
                                               SettingsTSql.GetSettingsByVslang(TatThanhJsc.LanguageModul.Cookie.GetLanguageValueAdmin())), "");
        if (dt.Rows.Count > 0)
        {
            string[] fields    = { "VSVALUE" };
            string[] values    = { "VSVALUE + 1" };
            string   condition = DataExtension.AndConditon(
                SettingsTSql.GetSettingsByVskey(SettingsExtension.KeyTotalView),
                SettingsTSql.GetSettingsByVslang(TatThanhJsc.LanguageModul.Cookie.GetLanguageValueAdmin()));
            Settings.UpdateSettings(DataExtension.UpdateTransfer(fields, values), condition);
        }
        else
        {
            Settings.InsertSettings(SettingsExtension.KeyTotalView, "", "0", TatThanhJsc.LanguageModul.Cookie.GetLanguageValueAdmin());
        }
    }
Esempio n. 26
0
    void UpdateEnable()
    {
        string valueUpdate = "";

        if (igenable.Equals("0"))
        {
            valueUpdate = "1";
        }
        else
        {
            valueUpdate = "0";
        }
        string[] fieldsDelGroup = { "IGENABLE", GroupsColumns.DgupdateColumn };
        string[] valuesDelGroup = { valueUpdate, "'" + DateTime.Now.ToString() + "'" };
        condition = " CHARINDEX('," + igid + ",',IGPARENTSID) > 0 ";
        Groups.UpdateGroupsCondition(DataExtension.UpdateTransfer(fieldsDelGroup, valuesDelGroup), condition);

        #region Logs
        string logAuthor     = CookieExtension.GetCookies("LoginSetting");
        string logCreateDate = DateTime.Now.ToString();
        string title         = GetTitle(igid);
        Logs.InsertLogs(logCreateDate, Request.Url.ToString(), "", title, logAuthor, "", logCreateDate + ": " + logAuthor + " thay đổi trạng thái " + title + " (id: " + igid + ")");
        #endregion
    }
    void UpdateEnable()
    {
        string valueUpdate = "";

        if (iienable.Equals("0"))
        {
            valueUpdate = "1";
        }
        else
        {
            valueUpdate = "0";
        }
        string[] fieldsDelGroup = { "IIENABLE" };
        string[] valuesDelGroup = { valueUpdate };
        condition = " IID = '" + iid + "' ";
        TatThanhJsc.Database.Items.UpdateItems(DataExtension.UpdateTransfer(fieldsDelGroup, valuesDelGroup), condition);

        #region Logs
        string logAuthor     = CookieExtension.GetCookies("LoginSetting");
        string logCreateDate = DateTime.Now.ToString();
        string title         = GetTitle(iid);
        Logs.InsertLogs(logCreateDate, Request.Url.ToString(), "", title, logAuthor, "", logCreateDate + ": " + logAuthor + " thay đổi trạng thái " + title + " (id: " + iid + ")");
        #endregion
    }
    void UpdateEnable()
    {
        string valueUpdate = "";

        if (igenable.Equals("0"))
        {
            valueUpdate = "1";
        }
        else
        {
            valueUpdate = "0";
        }
        string[] fieldsDelGroup = { "vgparams", GroupsColumns.DgupdateColumn };
        string[] valuesDelGroup = { "'*!<=*ParamsSpilitItems*=>*!" + valueUpdate + "' + SUBSTRING(vgparams,len('*!<=*ParamsSpilitItems*=>*!0')+1,LEN(vgparams)-len('*!<=*ParamsSpilitItems*=>*!0'))", "'" + DateTime.Now.ToString() + "'" };
        condition = " CHARINDEX('," + igid + ",',IGPARENTSID) > 0 ";
        Groups.UpdateGroupsCondition(DataExtension.UpdateTransfer(fieldsDelGroup, valuesDelGroup), condition);

        #region Logs
        string logAuthor     = CookieExtension.GetCookies("LoginSetting");
        string logCreateDate = DateTime.Now.ToString();
        string title         = GetTitle(igid);
        Logs.InsertLogs(logCreateDate, Request.Url.ToString(), "", title, logAuthor, "", logCreateDate + ": " + logAuthor + " thay đổi loại menu " + title + " (id: " + igid + ")");
        #endregion
    }
Esempio n. 29
0
 private void UpdateTotalView(string iid)
 {
     string[] fields = { "IITOTALVIEW" };
     string[] values = { "IITOTALVIEW + 1" };
     Items.UpdateItems(DataExtension.UpdateTransfer(fields, values), ItemsTSql.GetItemsByIid(iid));
 }
    void HuyBai()
    {
        #region Lấy tiêu đề bài viết
        string    postTitle  = "";
        string    condition2 = ItemsTSql.GetById(iid);
        string    fields     = DataExtension.GetListColumns(ItemsColumns.VititleColumn, ItemsColumns.VISEOMETAPARAMSColumn);
        string    orderby    = GroupsColumns.IgorderColumn;
        DataTable dt         = new DataTable();
        dt = GroupsItems.GetAllData("1", fields, condition2, orderby);
        if (dt.Rows.Count > 0)
        {
            postTitle = dt.Rows[0][ItemsColumns.VititleColumn].ToString();
        }
        #endregion

        #region Lấy info người đăng bài
        string    tenNguoiDangBai   = "";
        string    emailNguoiDangBai = "";
        DataTable dtUserDangBai     = Users.GetUsersByUserId(userid);
        if (dtUserDangBai.Rows.Count > 0)
        {
            tenNguoiDangBai   = dtUserDangBai.Rows[0][UsersColumns.UserfirstnameColumn].ToString() + " " + dtUserDangBai.Rows[0][UsersColumns.UserlastnameColumn].ToString();
            emailNguoiDangBai = dtUserDangBai.Rows[0][UsersColumns.UseremailColumn].ToString();
        }
        #endregion

        #region Lấy info người hủy bài
        DataTable dtUserHuyBai = Users.GetUsersByUserId(CookieExtension.GetCookies("UserId"));

        string tenNguoiHuyBai = "";

        if (dtUserHuyBai.Rows.Count > 0)
        {
            tenNguoiHuyBai = dtUserHuyBai.Rows[0][UsersColumns.UserfirstnameColumn].ToString() + " " + dtUserHuyBai.Rows[0][UsersColumns.UserlastnameColumn].ToString();
        }
        #endregion

        #region Đổi trạng thái hiển thị của item
        string[] fieldsDelGroup = { "IIENABLE" };
        string[] valuesDelGroup = { "3" };
        string   condition      = " IID = '" + iid + "' ";
        TatThanhJsc.Database.Items.UpdateItems(DataExtension.UpdateTransfer(fieldsDelGroup, valuesDelGroup), condition);
        #endregion

        #region Thêm thông tin ("", người hủy, thời gian hủy, nội dung hủy)
        string   data            = StringExtension.GhepChuoi("", tenNguoiHuyBai, content);
        string[] fieldsDelGroup2 = { "VISEOMETACANONICAL" };
        string[] valuesDelGroup2 = { "N'" + data + "'" };
        string[] fieldsDelGroup3 = { "VISEOMETALANG" };
        string[] valuesDelGroup3 = { "'" + DateTime.Now.ToString() + "'" };
        condition = " IID = '" + iid + "' ";
        TatThanhJsc.Database.Items.UpdateItems(DataExtension.UpdateTransfer(fieldsDelGroup2, valuesDelGroup2), condition);
        TatThanhJsc.Database.Items.UpdateItems(DataExtension.UpdateTransfer(fieldsDelGroup3, valuesDelGroup3), condition);
        #endregion

        #region Gửi mail tới thành viên
        string link = "", contentEmail = "";
        link         = UrlExtension.WebisteUrl + "admin.aspx?uc=" + uc + "&suc=QuanLyBaiVietBiHuy";
        contentEmail = @"
		<div style='color:#333'>
			<div>"             + LanguageItemExtension.GetnLanguageItemTitleByName("Xin chào") + @" " + tenNguoiDangBai + @"!</div>
			<br/>
			<div>"             + LanguageItemExtension.GetnLanguageItemTitleByName("Bài viết") + " <b>" + postTitle + @"</b> " + LanguageItemExtension.GetnLanguageItemTitleByName("của bạn đã bị hủy bỏ bởi") + @" <span style='color: blue'>" + tenNguoiHuyBai + @"</span> " + LanguageItemExtension.GetnLanguageItemTitleByName("với lời nhắn") + @":</div>
			<br />
			<div>"""             + content + @"""</div>
			<br />
			<div>"             + LanguageItemExtension.GetnLanguageItemTitleByName("Để xem danh sách các bài viết bị hủy, vui lòng click vào") + @" <a href='" + link + @"'>" + LanguageItemExtension.GetnLanguageItemTitleByName("đây") + @"</a>.</div>			
		</div>"        ;

        EmailExtension.SendEmail(emailNguoiDangBai, "Thông báo hủy bài viết từ " + UrlExtension.WebisteUrl, contentEmail);
        #endregion
    }