Ejemplo n.º 1
0
    protected void lnkTranslation_Click(object sender, EventArgs e)
    {
        //Id-ə görə əgər News table-inda varsa tərcümə üçün insert edek
        if (!DALCL.CheckNewsById(_newsId))
        {
            ConfigL.MsgBoxAjax("Tərcümə üçün xəbər mövcud deyil");
            return;
        }

        var dictionaryNewsLangs = new Dictionary <string, object>()
        {
            { "NewsId", _newsId },
            { "LangsId", Langs.Id },
            { "NewsLangsStatusId", (int)Tools.NewsLangsStatus.Hazırlanır },
            { "Title", "" },
            { "Subtitle", "" },
            { "ContentText", "" },
            { "VisitorCount", 0 },
            { "UpdatedDate", DateTime.Now },
            { "CreatedDate", DateTime.Now },
        };

        int resultId = DALC.InsertDatabase(Tools.Tables.NewsLangs, dictionaryNewsLangs);

        if (resultId < 1)
        {
            ConfigL.MsgBoxAjax(Config._AlertMessages.Error);
            return;
        }
        MultiView1.ActiveViewIndex = 0;
    }
Ejemplo n.º 2
0
    protected void chkSubscriptions_CheckedChanged(object sender, EventArgs e)
    {
        CheckBox check           = sender as CheckBox;
        string   isActive        = check.Attributes["data-isactive"];
        int      organizationsId = int.Parse(check.Attributes["data-id"]);

        Dictionary <string, object> dictionary = new Dictionary <string, object>();

        int result = 0;

        if (string.IsNullOrEmpty(isActive))
        {
            dictionary.Add("SurveysId", _surveysId);
            dictionary.Add("OrganizationsId", organizationsId);
            dictionary.Add("CreatedDate", DateTime.Now);
            dictionary.Add("IsActive", true);

            result = DALC.InsertDatabase(Tools.Tables.SurveysSubscriptions, dictionary);
        }
        else
        {
            dictionary.Add("IsActive", check.Checked);
            dictionary.Add("WhereId", int.Parse(check.Attributes["data-surveyssubscriptionsid"]));
            result = DALC.UpdateDatabase(Tools.Tables.SurveysSubscriptions, dictionary);
        }

        if (result < 1)
        {
            ConfigL.MsgBoxAjax(Config._AlertMessages.Error);
            return;
        }

        BindGrdSurveysSubscriptions();
    }
Ejemplo n.º 3
0
    protected void chkServicesVotesTypes_CheckedChanged(object sender, EventArgs e)
    {
        CheckBox check                = sender as CheckBox;
        string   isActive             = check.Attributes["data-isactive"];
        int      servicesVotesTypesId = int.Parse(check.Attributes["data-id"]);

        Dictionary <string, object> dictionary = new Dictionary <string, object>();

        int result = 0;

        if (string.IsNullOrEmpty(isActive))
        {
            dictionary.Add("ServicesId", _serviceId);
            dictionary.Add("ServicesVotesTypesId", servicesVotesTypesId);
            dictionary.Add("IsActive", true);

            result = DALC.InsertDatabase(Tools.Tables.ServicesVotesTypesRelations, dictionary);
        }
        else
        {
            dictionary.Add("IsActive", check.Checked);
            dictionary.Add("WhereId", int.Parse(check.Attributes["data-servicesvotestypesrelationsid"]));
            result = DALC.UpdateDatabase(Tools.Tables.ServicesVotesTypesRelations, dictionary);
        }

        if (result < 1)
        {
            ConfigL.MsgBoxAjax(Config._AlertMessages.Error);
            return;
        }

        BindGrdServicesVotesTypesRelations();
    }
Ejemplo n.º 4
0
    private void BindUsers()
    {
        DataTable dt = new DataTable();

        dt = DALCL.GetUsersById(_usersId);

        if (dt == null)
        {
            ConfigL.MsgBoxAjax(Config._AlertMessages.Error);
            return;
        }

        if (dt.Rows.Count < 1)
        {
            ConfigL.RedirectURL($"/{Langs.Name}/modules/registration");
            return;
        }

        dListSocialStatus.SelectedValue = dt._Rows("UsersSocialStatusId");
        txtDocumentNumber.Text          = dt._Rows("DocumentNumber");
        txtName.Text              = dt._Rows("Name");
        txtSurname.Text           = dt._Rows("Surname");
        txtPatronymic.Text        = dt._Rows("Patronymic");
        txtUsername.Text          = dt._Rows("Username");
        txtBirthDate.Text         = dt._RowsDatetime("BirthDate").ToString("dd.MM.yyyy");
        dListGender.SelectedValue = dt._Rows("UsersGendersId");
        txtAddress.Text           = dt._Rows("Address");
        txtEmail.Text             = dt._Rows("Email");
        txtContact.Text           = dt._Rows("Contact");
        txtDescription.Text       = dt._Rows("Description");
        dListStatus.SelectedValue = dt._Rows("UsersStatusId");
        imgUser.ImageUrl          = $"/uploads/users/{dt._Rows("Id")}_{dt._Rows("DocumentNumber")}.jpg";
    }
Ejemplo n.º 5
0
    private void BindServicesDetails()
    {
        DataTable dt = new DataTable();

        dt = DALCL.GetServicesById(_serviceId);

        if (dt == null)
        {
            ConfigL.MsgBoxAjax(Config._AlertMessages.Error);
            return;
        }

        if (dt.Rows.Count < 1)
        {
            ConfigL.RedirectURL($"/{Langs.Name}/modules/services");
            return;
        }

        txtTitle.Text             = dt._Rows("Title");
        txtNameLangs.Text         = dt._Rows("Name");
        txtDescriptionLangs.Text  = dt._Rows("Description");
        txtMinMinute.Text         = dt._Rows("MinMinute");
        txtDailyUse.Text          = dt._Rows("DailyUse");
        txtUseBetweenHour.Text    = dt._Rows("UseBetweenHour");
        txtExpireDate.Text        = dt._RowsDatetime("ExpireDate").ToString("dd.MM.yyyy");
        dListStatus.SelectedValue = dt._RowsBoolean("IsActive") ? "1" : "0";
    }
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _surveysId      = ConfigL._Route("id", "-1")._ToInt32();
        _operationsType = ConfigL._Route("type", "add");

        if (_operationsType == "edit")
        {
        }

        if (!IsPostBack)
        {
            ((Literal)Master.FindControl("LtrTitle")).Text = "SUAL CAVABLAR";
            BindDList();
            BindGrdSurveysSubscriptions();

            if (_operationsType == "add")
            {
                pnlAnswers.Visible = pnlSubscriptions.Visible = false;
            }
            else
            {
                txtTitle.Enabled   = false;
                pnlAnswers.Visible = pnlSubscriptions.Visible = true;

                BindSurveysDetails();
                BindSurveysAnswers();
            }
        }
    }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _serviceId      = ConfigL._Route("id", "-1")._ToInt32();
        _operationsType = ConfigL._Route("type", "add");

        if (_operationsType == "edit")
        {
            txtTitle.Enabled = false;
            pnlServicesVotesTypes.Visible = true;
        }

        if (!IsPostBack)
        {
            ((Literal)Master.FindControl("LtrTitle")).Text = "TƏDBİRLƏR";
            BindGrdServicesVotesTypesRelations();

            if (_operationsType == "add")
            {
            }
            else
            {
                BindServicesDetails();
            }
        }
    }
Ejemplo n.º 8
0
 protected void Page_PreInit(object sender, EventArgs e)
 {
     if (DALCL._Login == null)
     {
         ConfigL.RedirectLogin();
         return;
     }
 }
Ejemplo n.º 9
0
    public bool IsValidation()
    {
        if (FlUpCkEdit.HasFile)
        {
            ConfigL.MsgBoxAjax("Mətnə aid əlavə şəkillər seçili olduğu halda xəbəri təsdiqləmək olmaz.");
            return(false);
        }

        if (TxtTitle.Text.Length < 5)
        {
            ConfigL.MsgBoxAjax("Əsas başlığı yazın.");
            return(false);
        }

        if (TxtTitle.Text.Length > 300)
        {
            ConfigL.MsgBoxAjax("Əsas başlıq ən çox 300 simvoldan ibarət ola bilər.");
            return(false);
        }

        if (TxtTitleSub.Text.Length > 300)
        {
            ConfigL.MsgBoxAjax("Alt başlıq ən çox 300 simvoldan ibarət ola bilər.");
            return(false);
        }

        if (txtContent.Text.Length < 100)
        {
            ConfigL.MsgBoxAjax("Mətn ən az 100 simvoldan ibarət olmalıdır.");
            return(false);
        }

        if (_operations == "add")
        {
            //Xeberin esas shəklini mutleq secmelidir
            if (FlUpMain.HasFile)
            {
                if (_allowTypes.IndexOf("-" + System.IO.Path.GetExtension(FlUpMain.FileName).Trim('.').ToLower() + "-") < 0)
                {
                    ConfigL.MsgBoxAjax("Xəbərə aid əsas şəkilin formatı uyğun gəlmir.");
                    return(false);
                }
            }
            else
            {
                ConfigL.MsgBoxAjax("Xəbərə aid əsas şəkli seçin.");
                return(false);
            }
        }

        if (DListStatus.SelectedValue == "-1")
        {
            ConfigL.MsgBoxAjax("Xəbərin statusunu seçin.");
            return(false);
        }

        return(true);
    }
Ejemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _usersId = ConfigL._Route("id", "-1")._ToInt32();
        if (!IsPostBack)
        {
            ((Literal)Master.FindControl("LtrTitle")).Text = "İSTİFADƏ ETDİYİ XİDMƏTLƏRİN SİYAHISI";

            BindReports();
        }
    }
Ejemplo n.º 11
0
    protected void BtnCancel_Click(object sender, EventArgs e)
    {
        int NewsPageNum = 1;

        if (Session["NewsPageID"] != null)
        {
            NewsPageNum = int.Parse(Session["NewsPageID"].ToString());
        }

        ConfigL.RedirectURL(string.Format("/{0}/adminn/tools/news/{1}", Langs.Name, NewsPageNum));
    }
Ejemplo n.º 12
0
    private void BindUsers()
    {
        rptUsers.DataSource = null;
        rptUsers.DataBind();

        pnlFilter.ControlsBind(filterDictionary, tableName);

        int usersId;

        int.TryParse(txtUsersId.Text, out usersId);
        if (usersId == 0)
        {
            usersId = -1;
        }

        filterDictionary = new Dictionary <string, object>()
        {
            { "Id", usersId },
            { "OrganizationsId", DALCL._Login.organizationsId },
            { "UsersSocialStatusLangsId", (int)Tools.Langs.AZ },
            { "UsersSocialStatusId", int.Parse(dListSocialStatus.SelectedValue) },
            { "UsersGendersLangsId", (int)Tools.Langs.AZ },
        };

        int pageNumber;
        int rowNumber = 50;

        if (!int.TryParse(ConfigL._Route("pagenum", "1"), out pageNumber))
        {
            pageNumber = 1;
        }

        hdnPageNumber.Value = pageNumber.ToString();

        DALC.DataTableResult usersResult = DALC.GetFilterList(tableName, filterDictionary, pageNumber, rowNumber);

        if (usersResult.Count == -1)
        {
            return;
        }

        lblCount.Text = $"Axtarış üzrə nəticə: {usersResult.Count.ToString()}";

        int totalCount = usersResult.Count % rowNumber > 0 ? (usersResult.Count / rowNumber) + 1 : usersResult.Count / rowNumber;

        hdnTotalCount.Value = totalCount.ToString();

        pnlPager.Visible = usersResult.Count > rowNumber;

        rptUsers.DataSource = usersResult.Dt;
        rptUsers.DataBind();
    }
Ejemplo n.º 13
0
    private void BindNews()
    {
        RptNews.DataSource = null;
        RptNews.DataBind();

        PnlFilter.ControlsBind(FilterDictionary, TableName);

        int NewsID;

        int.TryParse(TxtNewsID.Text, out NewsID);
        if (NewsID == 0)
        {
            NewsID = -1;
        }

        FilterDictionary = new Dictionary <string, object>()
        {
            { "Id", NewsID },
            { "LangsId", Langs.Id },
            { "OrganizationsId", DALCL._Login.organizationsId },
            { "OrganizationsLangsId", Langs.Id },
            { "NewsLangsStatusId", int.Parse(DListNewsStatus.SelectedValue) }
        };

        int PageNum;
        int RowNumber = 50;

        if (!int.TryParse(ConfigL._Route("pagenum", "1"), out PageNum))
        {
            PageNum = 1;
        }

        HdnPageNumber.Value = PageNum.ToString();

        DALC.DataTableResult NewsResult = DALC.GetFilterList(Tools.Tables.V_News, FilterDictionary, PageNum, RowNumber);

        if (NewsResult.Count == -1)
        {
            return;
        }

        LblCount.Text = string.Format("Axtarış üzrə nəticə: {0}", NewsResult.Count.ToString());

        int Total_Count = NewsResult.Count % RowNumber > 0 ? (NewsResult.Count / RowNumber) + 1 : NewsResult.Count / RowNumber;

        HdnTotalCount.Value = Total_Count.ToString();

        PnlPager.Visible = NewsResult.Count > RowNumber;

        RptNews.DataSource = NewsResult.Dt;
        RptNews.DataBind();
    }
Ejemplo n.º 14
0
 protected void btnFilter_Click(object sender, EventArgs e)
 {
     try
     {
         PnlContent.Controls.Add(Page.LoadControl($"/modules/reports/usercontrols/{dlistReportsType.SelectedValue}.ascx"));
     }
     catch (Exception er)
     {
         DALC.ErrorLog("Report modules user control binding catch error: " + er.Message);
         ConfigL.RedirectError();
         return;
     }
 }
Ejemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Router ilə gəlmədikdə main ataq.
        if (string.IsNullOrEmpty(Langs.Name))
        {
            ConfigL.RedirectURL("/az/modules");
            return;
        }

        pnlMain.Style.Clear();

        if (!IsPostBack)
        {
            ltrOperatorName.Text = DALCL._Login.fullname;

            DataTable Dt    = DALCL.GetAdministratorsMenu(0);
            DataTable DtSub = new DataTable();

            RptLangs.DataSource = DALCL.GetAllLangs();
            RptLangs.DataBind();

            foreach (DataRow Dr in Dt.Rows)
            {
                DtSub = DALCL.GetAdministratorsMenu(Dr["ID"]._ToInt16());

                if (DtSub.Rows.Count < 1)
                {
                    LtrLeftMenu.Text += string.Format(
                        @"<li onclick=""location.href='/{0}/modules/{1}'; return false;"">
                                     <a href=""/{0}/modules/{1}""> 
                                         <img src=""/images/leftmenu/{2}.png""/>{3}
                                     </a>
                                 </li>", Langs.Name, Dr["PageName"], Dr["ID"], Dr["Name"]);
                }
                else
                {
                    LtrLeftMenu.Text += string.Format(@"<li class=""has-dropdown"">
                                                        <img src=""/images/leftmenu/{0}.png""/>{1}
                                                    </li>", Dr["ID"], Dr["Name"]);


                    LtrLeftMenu.Text += @"<ul class=""dropdown"">";
                    foreach (DataRow DrSub in DtSub.Rows)
                    {
                        LtrLeftMenu.Text += string.Format(@"<li><a href=""/{0}/modules/{1}"">{2}</a></li>", Langs.Name, DrSub["PageName"], DrSub["Name"]);
                    }
                    LtrLeftMenu.Text += "</ul>";
                }
            }
        }
    }
Ejemplo n.º 16
0
    private void BindAdministrators()
    {
        grdAdministrators.DataSource = null;
        grdAdministrators.DataBind();

        pnlFilter.ControlsBind(filterDictionary, tableName);

        int administratorsId;

        int.TryParse(txtAdministratorsId.Text, out administratorsId);
        if (administratorsId == 0)
        {
            administratorsId = -1;
        }

        filterDictionary = new Dictionary <string, object>()
        {
            { "Id", administratorsId },
            { "OrganizationsId", int.Parse(dListOrganizations.SelectedValue) },
            { "OrganizationsLangsId", (int)Tools.Langs.AZ },
            { "AdministratorsStatusId", int.Parse(dListAdministratorsStatus.SelectedValue) }
        };

        int pageNumber;
        int rowNumber = 50;

        if (!int.TryParse(ConfigL._Route("pagenum", "1"), out pageNumber))
        {
            pageNumber = 1;
        }

        HdnPageNumber.Value = pageNumber.ToString();

        DALC.DataTableResult administratorsResult = DALC.GetFilterList(tableName, filterDictionary, pageNumber, rowNumber);

        if (administratorsResult.Count == -1)
        {
            return;
        }

        lblCount.Text = string.Format("Axtarış üzrə nəticə: {0}", administratorsResult.Count.ToString());

        int totalCount = administratorsResult.Count % rowNumber > 0 ? (administratorsResult.Count / rowNumber) + 1 : administratorsResult.Count / rowNumber;

        hdnTotalCount.Value = totalCount.ToString();

        pnlPager.Visible = administratorsResult.Count > rowNumber;

        grdAdministrators.DataSource = administratorsResult.Dt;
        grdAdministrators.DataBind();
    }
Ejemplo n.º 17
0
    void BindNewsDetails(int newsId)
    {
        BindDetailsControls();

        DataTable dt = DALCL.GetNewsByID(newsId);

        if (dt == null)
        {
            ConfigL.MsgBoxAjax(Config._AlertMessages.Error);
            return;
        }

        if (dt.Rows.Count < 1)
        {
            MultiView1.ActiveViewIndex = 1;
            return;
        }

        DataTable dtLangs = DALCL.GetAllLangs();

        if (dtLangs == null)
        {
            ConfigL.MsgBoxAjax(Config._AlertMessages.Error);
            return;
        }
        string langs = dt._Rows("Langs");

        for (int i = 0; i < dtLangs.Rows.Count; i++)
        {
            ltrLangs.Text += $"<a href=\"/{dtLangs._Rows("Name", i)}/modules/news/operations/edit/{ConfigL._Route("id")}\">" +
                             $"<img src=\"/images/langs/{(("," + langs + ",").IndexOf("," + dtLangs._Rows("Id", i) + ",") > -1 ? $"{dtLangs._Rows("Name", i)}-lang" : $"{dtLangs._Rows("Name", i)}-lang-d")}.png\"/></a>";
        }

        DListNewsTypes.SelectedValue = dt._Rows("NewsTypesId");
        TxtTitle.Text       = dt._Rows("Title");
        TxtTitleSub.Text    = dt._Rows("SubTitle");
        LblSimvolCount.Text = "- simvol sayı : 300 / " + TxtTitleSub.Text.Length._ToString();

        TxtShowDate.Text = dt._RowsDatetime("ShowDate").ToString("dd.MM.yyyy HH:mm");

        txtContent.Text = dt._Rows("ContentText");

        ImgMedium.ImageUrl = $"{dt._Rows("Path")}?{((DateTime)dt._RowsObject("UpdatedDate")).Ticks.ToString()}";

        DListStatus.SelectedValue = dt._Rows("NewsLangsStatusId");

        //Update-də istifadə olunur
        BtnSave.CommandArgument = dt._Rows("NewsLangsId");

        BindImgDetails();
    }
Ejemplo n.º 18
0
    private void BindSurveys()
    {
        grdSurveys.DataSource = null;
        grdSurveys.DataBind();

        pnlFilter.ControlsBind(filterDictionary, tableName);

        int surveysId;

        int.TryParse(txtSurveysId.Text, out surveysId);
        if (surveysId == 0)
        {
            surveysId = -1;
        }

        filterDictionary = new Dictionary <string, object>()
        {
            { "Id", surveysId },
            { "LangsId", Langs.Id },
            { "SurveysStatusId", int.Parse(dListSurveysStatus.SelectedValue) }
        };

        int pageNumber;
        int rowNumber = 50;

        if (!int.TryParse(ConfigL._Route("pagenum", "1"), out pageNumber))
        {
            pageNumber = 1;
        }

        HdnPageNumber.Value = pageNumber.ToString();

        DALC.DataTableResult surveysResult = DALC.GetFilterList(tableName, filterDictionary, pageNumber, rowNumber);

        if (surveysResult.Count == -1)
        {
            return;
        }

        lblCount.Text = string.Format("Axtarış üzrə nəticə: {0}", surveysResult.Count.ToString());

        int totalCount = surveysResult.Count % rowNumber > 0 ? (surveysResult.Count / rowNumber) + 1 : surveysResult.Count / rowNumber;

        hdnTotalCount.Value = totalCount.ToString();

        pnlPager.Visible = surveysResult.Count > rowNumber;

        grdSurveys.DataSource = surveysResult.Dt;
        grdSurveys.DataBind();
    }
Ejemplo n.º 19
0
    protected void Page_PreInit(object sender, EventArgs e)
    {
        if (DALCL._Login == null)
        {
            ConfigL.RedirectLogin();
            return;
        }

        if (!DALCL.CheckPermission(Tools.AdministratorsMenu.Tədbirlər))
        {
            ConfigL.RedirectError();
            return;
        }
    }
Ejemplo n.º 20
0
 protected void LnkImgDeleted_Command(object sender, CommandEventArgs e)
 {
     try
     {
         LinkButton lnk = sender as LinkButton;
         new System.IO.FileInfo(Server.MapPath(e.CommandArgument._ToString())).Delete();
         new System.IO.FileInfo(Server.MapPath(e.CommandArgument._ToString().Replace("othersmall", "other"))).Delete();
         DALCL.DeleteFiles(Tools.Tables.NewsFiles, int.Parse(e.CommandName));
         BindImgDetails();
     }
     catch
     {
         ConfigL.MsgBoxAjax("Şəkil silinə bilmədi.");
     }
 }
Ejemplo n.º 21
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(txtLogin.Text))
        {
            ConfigL.MsgBoxAjax("İstifadəçi adınızı daxil edin!");
            return;
        }

        if (string.IsNullOrEmpty(txtPassword.Text))
        {
            ConfigL.MsgBoxAjax("İstifadəçi şifrənizi daxil edin!");
            return;
        }

        DataTable dtLoginControl = DALC.GetDataTable("*", Tools.Tables.V_Administrators, "Username,Password,AdministratorsStatusId", new object[] { txtLogin.Text, txtPassword.Text.SHA1Special(), (int)Tools.AdministratorsStatus.Aktiv });

        if (dtLoginControl == null)
        {
            ConfigL.MsgBoxAjax(Config._AlertMessages.Error);
            return;
        }

        if (dtLoginControl.Rows.Count < 1)
        {
            ConfigL.MsgBoxAjax("Giriş baş tutmadı!");
            return;
        }

        DALCL.Login loginInfo = new DALCL.Login();
        loginInfo.organizationsId        = dtLoginControl._RowsInt("OrganizationsId");
        loginInfo.organizationsName      = dtLoginControl._Rows("OrganizationsName");
        loginInfo.calendarOganizationsId = dtLoginControl._RowsInt("CalendarOganizationsId");
        loginInfo.administratorsId       = dtLoginControl._RowsInt("ID");
        loginInfo.fullname    = dtLoginControl._Rows("Fullname");
        loginInfo.permissions = dtLoginControl._Rows("AdministratorsMenuList");

        Session["Login"] = loginInfo;

        if (DALCL.CheckPermission(Tools.AdministratorsMenu.Kalendar))
        {
            ConfigL.RedirectURL("/az/modules/calendar");
        }
        else
        {
            ConfigL.RedirectURL("/az/modules/");
        }
    }
Ejemplo n.º 22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _administratorsId = ConfigL._Route("id", "-1")._ToInt32();
        _operationsType   = ConfigL._Route("type", "add");

        if (!IsPostBack)
        {
            ((Literal)Master.FindControl("LtrTitle")).Text = "QEYDİYYAT İDARƏÇİLƏR";
            BindList();

            if (_operationsType != "add")
            {
                BindAdministrators();
                txtUsername.Enabled = false;
            }
        }
    }
Ejemplo n.º 23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (DALCL._Login == null)
        {
            ConfigL.RedirectLogin();
            return;
        }

        if (!DALCL.CheckPermission(Tools.AdministratorsMenu.Təşkilatlar))
        {
            ConfigL.RedirectError();
            return;
        }

        if (DALCL._Login.calendarOganizationsId < 1)
        {
            MultiView1.ActiveViewIndex = 1;
            return;
        }

        _calendarId     = ConfigL._Route("id", "-1")._ToInt32();
        _operationsType = ConfigL._Route("type", "add");

        if (!IsPostBack)
        {
            if (ConfigL._GetQueryString("selectedDate").Length > 0)
            {
                txtStartDate.Text = ConfigL._GetQueryString("selectedDate") + " 09:00";
            }

            ((Literal)Master.FindControl("LtrTitle")).Text = "KALENDAR İDARƏETMƏ";

            BindList();

            if (_operationsType != "add")
            {
                BindCalendar();
            }
            else
            {
                dListStatus.SelectedValue = "1";
                dListStatus.Enabled       = false;
            }
        }
    }
Ejemplo n.º 24
0
    protected void lnlkEdit_Click(object sender, EventArgs e)
    {
        btnSave.Text            = "DÜZƏLT";
        btnSave.CommandArgument = (sender as LinkButton).CommandArgument;

        DataTable dtDetail = DALCL.GetCalendarOrganizationsById(int.Parse(btnSave.CommandArgument));

        if (dtDetail == null || dtDetail.Rows.Count < 1)
        {
            ConfigL.MsgBoxAjax(Config._AlertMessages.Error);
            return;
        }

        txtName.Text              = dtDetail._Rows("Name");
        txtShortName.Text         = dtDetail._Rows("Shortname");
        dListStatus.SelectedValue = dtDetail._RowsBoolean("IsActive") ? "1" : "0";
        DlistPublic.SelectedValue = dtDetail._RowsBoolean("IsPublic") ? "1" : "0";
    }
Ejemplo n.º 25
0
    protected void lnkDeletedAnswer_Click(object sender, EventArgs e)
    {
        var dictionary = new Dictionary <string, object>()
        {
            { "IsActive", false },
            { "WhereId", (sender as LinkButton).CommandArgument }
        };

        int result = DALC.UpdateDatabase(Tools.Tables.SurveysAnswers, dictionary);

        if (result < 1)
        {
            ConfigL.MsgBoxAjax(Config._AlertMessages.Error);
            return;
        }

        BindSurveysAnswers();
    }
Ejemplo n.º 26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int.TryParse(ConfigL._Route("servicestypesid"), out _servicesTypesId);
        if (!IsPostBack)
        {
            if (_servicesTypesId == (int)Tools.ServicesTypes.Xidmətlər)
            {
                ((Literal)Master.FindControl("LtrTitle")).Text = "XİDMƏTLƏR";
                ltrAddServices.Text = "YENİ XİDMƏT";
            }
            else
            {
                ((Literal)Master.FindControl("LtrTitle")).Text = "TƏDBİRLƏR";
                ltrAddServices.Text = "YENİ TƏDBİR";
            }

            BindServices();
        }
    }
Ejemplo n.º 27
0
    protected void lnkDeleted_Click(object sender, EventArgs e)
    {
        var dictionaryServicesOrganizations = new Dictionary <string, object>()
        {
            { "IsActive", false },
            { "WhereId", int.Parse((sender as LinkButton).CommandArgument) }
        };

        int resultId = DALC.UpdateDatabase(Tools.Tables.ServicesOrganizations, dictionaryServicesOrganizations);

        if (resultId < 1)
        {
            ConfigL.MsgBoxAjax(Config._AlertMessages.Error);
            return;
        }

        BindServicesOrganizations();
        BindDList();
        ConfigL.MsgBoxAjax(Config._AlertMessages.Success);
    }
Ejemplo n.º 28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (DALCL._Login == null)
        {
            ConfigL.RedirectLogin();
            return;
        }

        if (!DALCL.CheckPermission(Tools.AdministratorsMenu.Təşkilatlar))
        {
            ConfigL.RedirectError();
            return;
        }

        if (!IsPostBack)
        {
            ((Literal)Master.FindControl("LtrTitle")).Text = "TƏŞKİLATLAR";
            BindCalendar();
        }
    }
Ejemplo n.º 29
0
    private void BindAdministrators()
    {
        DataTable dt = DALCL.GetAdministratorsById(_administratorsId);

        if (dt == null)
        {
            ConfigL.MsgBoxAjax(Config._AlertMessages.Error);
            return;
        }

        if (dt.Rows.Count < 1)
        {
            ConfigL.RedirectURL($"/{Langs.Name}/modules/registration");
            return;
        }

        dlistCalendar.SelectedValue      = dt._Rows("CalendarOganizationsId");
        dListOrganizations.SelectedValue = dt._Rows("OrganizationsId");
        txtUsername.Text = dt._Rows("Username");
        txtFullName.Text = dt._Rows("Fullname");
        txtPosition.Text = dt._Rows("Position");
        txtPhone.Text    = dt._Rows("Phone");
        txtEmail.Text    = dt._Rows("Email");

        dListAdministratorsStatusId.SelectedValue = dt._Rows("AdministratorsStatusId");

        string list = $",{dt._Rows("AdministratorsMenuList")},";

        for (int i = 0; i < grdAdministratorsMenu.Rows.Count; i++)
        {
            ((CheckBox)grdAdministratorsMenu.Rows[i].Cells[1].Controls[1]).Checked = (list == ",*," || (list.IndexOf($",{grdAdministratorsMenu.DataKeys[i]["Id"]._ToString()},") > -1));
        }

        imgUser.ImageUrl = $"/uploads/administrators/{dt._Rows("Id")}.jpg";

        //Özü olanda permissionlarını dəyişə bilməsin.
        if (_administratorsId == DALCL._Login.administratorsId)
        {
            grdAdministratorsMenu.Enabled = false;
        }
    }
Ejemplo n.º 30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (DALCL._Login == null)
        {
            ConfigL.RedirectLogin();
            return;
        }

        if (!DALCL.CheckPermission(Tools.AdministratorsMenu.Kalendar))
        {
            ConfigL.RedirectError();
            return;
        }

        ((Literal)Master.FindControl("LtrTitle")).Text = "KALENDAR";

        if (!IsPostBack)
        {
            DlistOrganizations.DataSource = DALC.GetDataTable("Id,Name", Tools.Tables.CalendarOganizations, "Where IsActive=1 Order by Name asc");
            DlistOrganizations.DataBind();
            DlistOrganizations.Items.Insert(0, new ListItem("--", "0"));

            DlistTypes.DataSource = DALC.GetDataTable("Id,Name", Tools.Tables.CalendarTypes, "Where IsActive=1 Order by Priority asc");
            DlistTypes.DataBind();
            DlistTypes.Items.Insert(0, new ListItem("--", "0"));

            for (int i = 0; i < MonthList.Length; i++)
            {
                DlistMonth.Items.Add(new ListItem(MonthList[i], (i + 1).ToString()));
            }

            for (int i = 2015; i < DateTime.Now.Year + 5; i++)
            {
                DlistYear.Items.Add(i.ToString());
            }

            LnkToday.Text = $"Bugün ({DateTime.Now.ToString("dd.MM.yyyy")})";

            ICalendarDataBind(DateTime.Now.Month, DateTime.Now.Year);
        }
    }