Example #1
0
    protected void LnkOtherApp_Click(object sender, EventArgs e)
    {
        GrdList.DataSource = null;
        GrdList.DataBind();

        LnkOtherApp.Visible         = false;
        LblCount.Text               = "Axtarış üzrə: 0      Səhifə üzrə: 0";
        LnkOtherApp.CommandArgument = (int.Parse(LnkOtherApp.CommandArgument) + 20)._ToString();


        Dictionary <string, object> Dictionary = new Dictionary <string, object>()
        {
            { "Username(LIKE)", TxtFilterUsername.Text },
            { "Fullname(LIKE)", TxtFilterFullname.Text.Replace("i", "İ").Replace("ı", "I").ToUpper() },
            { "IsActive", int.Parse(DListFilterStatus.SelectedValue) }
        };

        DALC.DataTableResult AdoptionAdministrators = DALC_Adoption.GetAdoptionAdministrator(int.Parse(LnkOtherApp.CommandArgument), Dictionary, "");

        if (AdoptionAdministrators.Count == -1)
        {
            Config.MsgBoxAjax(Config._DefaultSystemErrorMessages, Page);
            return;
        }

        GrdList.DataSource = AdoptionAdministrators.Dt;
        GrdList.DataBind();

        LblCount.Text = "Axtarış üzrə: " + AdoptionAdministrators.Count + "      Səhifə üzrə: " + GrdList.Rows.Count._ToString();

        if (AdoptionAdministrators.Dt.Rows.Count > 0)
        {
            LnkOtherApp.Visible = (GrdList.Rows.Count < AdoptionAdministrators.Count);
        }
    }
Example #2
0
    protected void LnkOtherApp_Click(object sender, EventArgs e)
    {
        GrdHistory.DataSource = null;
        GrdHistory.DataBind();

        LnkOtherApp.Visible         = false;
        LblCount.Text               = "Axtarış üzrə: 0      Səhifə üzrə: 0";
        LnkOtherApp.CommandArgument = (int.Parse(LnkOtherApp.CommandArgument) + 20)._ToString();

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

        DictHistory.Add("AdoptionAdministratorsID", int.Parse(DListUsersName.SelectedValue));

        DALC.DataTableResult AdoptionAdministratorHistory = DALC_Adoption.GetAdoptionAdministratorHistory(int.Parse(LnkOtherApp.CommandArgument), DictHistory, "");

        if (AdoptionAdministratorHistory.Count == -1)
        {
            Config.MsgBoxAjax(Config._DefaultSystemErrorMessages, Page);
            return;
        }

        GrdHistory.DataSource = AdoptionAdministratorHistory.Dt;
        GrdHistory.DataBind();

        LblCount.Text = "Axtarış üzrə: " + AdoptionAdministratorHistory.Count + "      Səhifə üzrə: " + GrdHistory.Rows.Count._ToString();

        if (AdoptionAdministratorHistory.Dt.Rows.Count > 0)
        {
            LnkOtherApp.Visible = (GrdHistory.Rows.Count < AdoptionAdministratorHistory.Count);
        }

        BtnSearch.CommandArgument = "";
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DListAdoptionPersonStatus.DataSource = DALC_Adoption.GetAdoptionPersonsStatus();
         DListAdoptionPersonStatus.DataBind();
         DListAdoptionPersonStatus.Items.Insert(0, new ListItem("--", "-1"));
         BindNeeders();
     }
 }
    private void BindNeeders()
    {
        GrdAdoptionPersonsList.DataSource = null;
        GrdAdoptionPersonsList.DataBind();

        PnlFilter.BindControls(FilterDictionary, _TableName);
        DListStatusType_SelectedIndexChanged(null, null);
        FilterDictionary = new Dictionary <string, object>()
        {
            { "Ap.ID", TxtID.Text },
            { "CONCAT(Soyad,' ',Ad,' ',Ata)(LIKE)", TxtFullname.Text },
            { "IsWebPreview", DListIsWebPreview.SelectedValue },
            { "IsBrotherSister", DListIsBrotherSister.SelectedValue },
            { "AdoptionPersonsStatusID", int.Parse(AdoptionPersonsStatusID) }
        };

        if (DListStatusType.SelectedIndex == 0)
        {
            FilterDictionary.Add("AdoptionPersonsStatusID(NOTIN)", 90);
        }

        int PageNum;
        int RowNumber = 16;

        if (!int.TryParse(Config._GetQueryString("pn"), out PageNum))
        {
            PageNum = 1;
        }

        HdnPageNumber.Value = PageNum.ToString();

        DALC.DataTableResult AdoptionPersonsResult = DALC_Adoption.GetAdoptionPersons(FilterDictionary, PageNum, RowNumber);

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

        if (AdoptionPersonsResult.Dt.Rows.Count < 1 && PageNum > 1)
        {
            Config.Redirect(string.Format("/adoptionadminn/tools/?p=adoptionpersons&pn={0}", PageNum - 1));
        }

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

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

        HdnTotalCount.Value = Total_Count.ToString();

        PnlPager.Visible = AdoptionPersonsResult.Count > RowNumber;

        GrdAdoptionPersonsList.DataSource = AdoptionPersonsResult.Dt;
        GrdAdoptionPersonsList.DataBind();
    }
Example #5
0
    //hansi filterler doldurulubsa onlari goturmek loglama ucun
    private void CheckControls()
    {
        string SearchFilters = "";

        foreach (Control item in PnlSearch.Controls)
        {
            if (item is TextBox)
            {
                if (!string.IsNullOrEmpty((item as TextBox).Text))
                {
                    SearchFilters += "Tam adı:" + (item as TextBox).Text;
                }
            }
            if (item is DropDownList)
            {
                if ((item as DropDownList).SelectedValue != "-1")
                {
                    string DListTitle = "";
                    if ((item as DropDownList).ID == "DListGender")
                    {
                        DListTitle = "Cinsi:";
                    }
                    if ((item as DropDownList).ID == "DListEyeColor")
                    {
                        DListTitle = "Göz rəngi:";
                    }
                    if ((item as DropDownList).ID == "DListHairColor")
                    {
                        DListTitle = "Saç rəngi:";
                    }
                    if ((item as DropDownList).ID == "DListAgeRange")
                    {
                        DListTitle = "Yaş aralığı:";
                    }
                    if ((item as DropDownList).ID == "DListBrotherSister")
                    {
                        DListTitle = "Qardaş, Bacı mövcudluğu:";
                    }
                    SearchFilters += DListTitle + (item as DropDownList).SelectedItem.Text + ",";
                }
            }
        }

        if (string.IsNullOrEmpty(SearchFilters))
        {
            SearchFilters = "Ümumi axtarış edildi.";
        }
        if (Session["IsSearch"] == null && !string.IsNullOrEmpty(Config._GetQueryString("pn")))
        {
            DALC_Adoption.SearchLogInsert(LoginInfo[0], LoginInfo[1], DALC_Adoption._GetUsersLogin.AdoptionOrganizationsID._ToString(), DALC_Adoption._GetUsersLogin.RegisterNo._ToString(), DALC_Adoption._GetUsersLogin.RegisterDate, "<b>Axtarış edildi</b> | " + SearchFilters.TrimEnd(','));
            Session["IsSearch"] = true;
        }
    }
Example #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //PnlPermission.Height = Unit.Pixel(700);
            PnlAdministrators.Height = Unit.Pixel(700);

            DListPermissions.DataSource = DALC_Adoption.GetAdoptionAdministratorsStatus();
            DListPermissions.DataBind();
            DListPermissions.Items.Insert(0, new ListItem("--", "0"));

            LnkOtherApp_Click(null, null);
        }
    }
    private void BindData()
    {
        GrdUserLogs.DataSource = null;
        GrdUserLogs.DataBind();

        FilterDictionary = new Dictionary <string, object>()
        {
            { "PIN", TxtPin.Text },
            { "AdoptionOrganizationsID", DListOrganizations.SelectedValue },
            { "RegisterNo", TxtRegisterNo.Text },
            { "SearchParams(LIKE)", TxtContent.Text }
        };

        int PageNum;
        int RowNumber = 20;

        if (!int.TryParse(Config._GetQueryString("pn"), out PageNum))
        {
            PageNum = 1;
        }

        HdnPageNumber.Value = PageNum.ToString();

        DALC.DataTableResult AdoptionSearchResult = DALC_Adoption.GetAdoptionSearchHistory(FilterDictionary, PageNum, RowNumber);

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

        if (AdoptionSearchResult.Dt.Rows.Count < 1 && PageNum > 1)
        {
            Config.Redirect(string.Format("/adoptionadminn/tools/?p=servicesuserslogs&pn={0}", PageNum - 1));
        }

        LblCount.Text = string.Format("Tapılıb: {0}", AdoptionSearchResult.Count.ToString());

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

        HdnTotalCount.Value = Total_Count.ToString();

        PnlPager.Visible = AdoptionSearchResult.Count > RowNumber;

        GrdUserLogs.DataSource = AdoptionSearchResult.Dt;
        GrdUserLogs.DataBind();
    }
Example #8
0
    protected void BtnLogin_Click(object sender, EventArgs e)
    {
        #region Validator Inputs
        DListOrganizations.BorderColor = TxtRegisterNo.BorderColor = TxtRegisterDt.BorderColor = System.Drawing.Color.Empty;
        if (DListOrganizations.SelectedValue == "-1")
        {
            DListOrganizations.Focus();
            DListOrganizations.BorderColor = System.Drawing.Color.FromArgb(244, 67, 54);
            PnlError.Visible = true;
            LtrError.Text    = "İcra hakimiyyətini seçin.";
            return;
        }
        if (string.IsNullOrEmpty(TxtRegisterNo.Text))
        {
            ErrorMessages(TxtRegisterNo, "Uçot nömrəsi qeyd olunmayıb.");
            return;
        }
        if (!Config.IsNumeric(TxtRegisterNo.Text))
        {
            ErrorMessages(TxtRegisterNo, "Uçot nömrəsi düzgün formatda doldurulmayıb.");
            return;
        }
        if (string.IsNullOrEmpty(TxtRegisterDt.Text))
        {
            ErrorMessages(TxtRegisterDt, "Uçot tarixi qeyd olunmayıb.");
            return;
        }
        if (Config.DateFormatClear(TxtRegisterDt.Text) == null)
        {
            ErrorMessages(TxtRegisterDt, "Uçot tarixi düzgün formatda qeyd olunmayıb.");
            return;
        }

        #endregion

        LoginInfo = (string[])Session["EgovLogin"];
        string OrganizationsID            = DListOrganizations.SelectedValue;
        DALC_Adoption.UsersInfo UsersInfo = new DALC_Adoption.UsersInfo();
        UsersInfo.AdoptionOrganizationsID = int.Parse(OrganizationsID);
        UsersInfo.RegisterNo   = int.Parse(TxtRegisterNo.Text);
        UsersInfo.RegisterDate = (DateTime)Config.DateFormatClear(TxtRegisterDt.Text);

        DALC_Adoption.SearchLogInsert(LoginInfo[0], LoginInfo[1], OrganizationsID, TxtRegisterNo.Text, UsersInfo.RegisterDate, "<span style=\"color:green;font-weight:bold\">Xidmətə giriş edildi.</span>");
        Session["UsersLogin"] = UsersInfo;
        Config.Redirect("/e-services/adoption/?pn=1");
    }
Example #9
0
    protected void BtnConfirm_Click(object sender, EventArgs e)
    {
        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "TabChange", "$(document).ready(function(){$('#password-tab').click();});", true);
        if (TxtOldPassword.Text.Length < 1)
        {
            Config.MsgBoxAjax("Köhnə şifrəni daxil edin.", Page);
            return;
        }

        if (TxtNewPassword.Text.Length < 4)
        {
            Config.MsgBoxAjax("Yeni şifrə ən az 4 simvoldan ibarət olmalıdır.", Page);
            return;
        }

        if (TxtNewPassword.Text != TxtBackPassword.Text)
        {
            Config.MsgBoxAjax("Yeni şifrələr uyğun gəlmir!", Page);
            return;
        }

        if (Config.SHA1Special(TxtOldPassword.Text) != DALC.GetDbSingleValuesParams("Password", "AdoptionAdministrators", "ID", DALC_Adoption._GetAdoptionAdministratorsLogin.ID, "", ""))
        {
            Config.MsgBoxAjax("Köhnə şifrəniz yalnışdır", Page);
            return;
        }

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

        Dictionary.Add("WhereID", DALC_Adoption._GetAdoptionAdministratorsLogin.ID);
        Dictionary.Add("Password", Config.SHA1Special(TxtNewPassword.Text));

        int ChekUpdate = DALC.UpdateDatabase("AdoptionAdministrators", Dictionary);

        if (ChekUpdate < 1)
        {
            Config.MsgBoxAjax(Config._DefaultSystemErrorMessages, Page);
        }
        else
        {
            DALC_Adoption.AdoptionAdministratorsHistoryInsert("Şifrəsini dəyişdi. Köhnə şifrə: " + TxtOldPassword.Text.Trim());
            Config.MsgBoxAjax("Əməliyyat uğurla yerinə yetirildi.", Page, true);
        }
    }
Example #10
0
    protected void LnkEdit_Click(object sender, EventArgs e)
    {
        ShowModal();
        LtrModalHeader1.Text     = "Düzəliş";
        PnlResetPassword.Visible = true;
        ChkIsActive.Enabled      = true;
        string    AdminID = BtnSaveUsers.CommandArgument = (sender as LinkButton).CommandArgument;
        DataTable Dt      = DALC_Adoption.GetAdministratorByID(AdminID._ToInt32());

        if (Dt == null)
        {
            Config.MsgBoxAjax(Config._DefaultSystemErrorMessages, Page);
            return;
        }

        if (Dt.Rows.Count < 1)
        {
            Config.MsgBoxAjax("Məlumat tapılmadı.", Page);
            return;
        }

        TxtUsername.Enabled  = false;
        PnlPassword.Visible  = false;
        TxtUsername.Text     = Dt._Rows("Username");
        TxtDepartment.Text   = Dt._Rows("Department");
        TxtPosition.Text     = Dt._Rows("Position");
        TxtFullname.Text     = Dt._Rows("Fullname");
        TxtEmail.Text        = Dt._Rows("Email");
        TxtContacts.Text     = Dt._Rows("Contacts");
        TxtDescription.Text  = Dt._Rows("Description");
        TxtPermissionIP.Text = Dt._Rows("PermissionIP");
        ChkIsActive.Checked  = Convert.ToBoolean(Dt._Rows("IsActive"));
        if (string.IsNullOrEmpty(DListPermissions.SelectedValue))
        {
            DListPermissions.SelectedIndex = 0;
        }
        else
        {
            DListPermissions.SelectedValue = Dt._Rows("AdoptionAdministratorsStatusID");
        }
        LblPass.Text = "";
    }
Example #11
0
    public void AdoptionAdministratorCheck()
    {
        DataTable Dt = DALC.GetDataTableMultiParams("*", "AdoptionAdministrators", new string[] { "Username", "Password", "IsActive" }, new object[] { Username, Password.SHA1Special(), true }, "");

        if (Dt == null)
        {
            Config.MsgBoxAjax(Config._DefaultSystemErrorMessages, Page);
            return;
        }

        if (Dt.Rows.Count != 1)
        {
            Config.MsgBoxAjax("Giriş baş tutmadı!", Page);
            return;
        }

        if (Dt._Rows("PermissionIP") != "*")
        {
            if (Dt._Rows("PermissionIP").IndexOf(Request.UserHostAddress) < 0)
            {
                Config.MsgBoxAjax("Mövcud IP üzrə sistemə giriş hüququnuz yoxdur.", Page);
                return;
            }
        }

        //Success
        DALC_Adoption.AdoptionAdministratorsInfoClass AdoptionAdministratorsInfoClass = new DALC_Adoption.AdoptionAdministratorsInfoClass();
        AdoptionAdministratorsInfoClass.ID       = Dt._RowsObject("ID")._ToInt16();
        AdoptionAdministratorsInfoClass.Fullname = Dt._Rows("Fullname");

        Session["AdoptionAdminLogin"] = AdoptionAdministratorsInfoClass;
        DALC_Adoption.AdoptionAdministratorsHistoryInsert("Sistemə giriş etdi.");

        if (Config._GetQueryString("return").Length > 0)
        {
            Config.Redirect(Config._GetQueryString("return"));
        }
        else
        {
            Config.Redirect("/adoptionadminn/tools/");
        }
    }
Example #12
0
    protected void BtnResetPassword_Click(object sender, EventArgs e)
    {
        string ResetPassword = Config.Key(6);
        Dictionary <string, object> Dictionary = new Dictionary <string, object>();

        Dictionary.Add("Password", ResetPassword.SHA1Special());
        Dictionary.Add("WhereID", int.Parse(BtnSaveUsers.CommandArgument));

        int Chek = DALC.UpdateDatabase("AdoptionAdministrators", Dictionary);

        if (Chek < 1)
        {
            Config.MsgBoxAjax(Config._DefaultSystemErrorMessages, Page);
            return;
        }

        DALC_Adoption.AdoptionAdministratorsHistoryInsert(BtnSaveUsers.CommandArgument + " № li İstifadəçinin şifərsi dəyişdirildi(Reset Password). Yeni şifrə: " + ResetPassword.Substring(0, 3) + "***");
        Config.MsgBoxAjax("İstfifadəçi şifrəsi yeniləndi. ", Page, true);
        LblPass.Text = "Yeni şifrə: <b>" + ResetPassword + "</b>";
    }
Example #13
0
    protected void BtnConfirm_Click(object sender, EventArgs e)
    {
        lang = Config._GetQueryString("lang");
        string ErrorMessage = "";

        ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "CallDatePicker", "CallDatePicker();", true);
        TxtName.CssClass         = TxtSurname.CssClass = TxtMobileNumber.CssClass = TxtEmail.CssClass = "form-control form-inputs";
        TxtBirthDate.CssClass    = "form-control form_datetime form-inputs";
        DListBirthPlace.CssClass = DListGender.CssClass = DListNationality.CssClass = DListChildAge.CssClass = DListChildGender.CssClass = "form-control input-filter form-inputs";
        PnlAlert.Visible         = false;

        #region Validations
        try
        {
            dynamic capthaResult = Newtonsoft.Json.Linq.JObject.Parse(DALC_Adoption.WebRequestMethod(string.Format(Config._GetAppSettings("GoogleCapthaValid").Decrypt(), Request["g-recaptcha-response"]._ToString(), Request.UserHostAddress), string.Empty));
            if (!(bool)capthaResult.success)
            {
                if (lang == "az")
                {
                    ErrorMessage = "Təhlükəsizlik qutusunu işarələyin.";
                }
                else if (lang == "ru")
                {
                    ErrorMessage = "Təhlükəsizlik qutusunu işarələyin.";
                }
                else if (lang == "en")
                {
                    ErrorMessage = "Please check the security box.";
                }
                PnlAlert.Visible = true;
                LtrAlert.Text    = ErrorMessage;
                return;
            }
        }
        catch (Exception er)
        {
            DALC.ErrorLogsInsert(string.Format("Google captcha catch error TableName: {0} count xəta: {1}", "AdoptionForeign", er.Message));
            Response.Write(Config._DefaultSystemErrorMessages);
            Response.End();
            return;
        }

        if (string.IsNullOrEmpty(TxtName.Text))
        {
            if (lang == "az")
            {
                ErrorMessage = "Adı qeyd edin.";
            }
            else if (lang == "ru")
            {
                ErrorMessage = "Adı qeyd edin.";
            }
            else if (lang == "en")
            {
                ErrorMessage = "Please type the name.";
            }
            ErrorMessagesTextbox(TxtName, ErrorMessage);
            return;
        }

        if (string.IsNullOrEmpty(TxtSurname.Text))
        {
            if (lang == "az")
            {
                ErrorMessage = "Soyadı qeyd edin.";
            }
            else if (lang == "ru")
            {
                ErrorMessage = "Soyadı qeyd edin.";
            }
            else if (lang == "en")
            {
                ErrorMessage = "Please type the surname.";
            }
            ErrorMessagesTextbox(TxtSurname, ErrorMessage);
            return;
        }

        if (DListGender.SelectedValue == "-1")
        {
            if (lang == "az")
            {
                ErrorMessage = "Cins seçilməyib.";
            }
            else if (lang == "ru")
            {
                ErrorMessage = "Cins seçilməyib.";
            }
            else if (lang == "en")
            {
                ErrorMessage = "Cins seçilməyib.";
            }
            ErrorMessagesDropList(DListGender, ErrorMessage);
            return;
        }

        if (string.IsNullOrEmpty(TxtBirthDate.Text))
        {
            if (lang == "az")
            {
                ErrorMessage = "Doğum tarixini qeyd edin.";
            }
            else if (lang == "ru")
            {
                ErrorMessage = "Doğum tarixini qeyd edin.";
            }
            else if (lang == "en")
            {
                ErrorMessage = "Doğum tarixini qeyd edin.";
            }
            ErrorMessagesTextbox(TxtBirthDate, ErrorMessage);
            return;
        }

        if (Config.DateFormatClear(TxtBirthDate.Text) == null)
        {
            if (lang == "az")
            {
                ErrorMessage = "Doğum tarixini düzgün formatda daxil edin.";
            }
            else if (lang == "ru")
            {
                ErrorMessage = "Doğum tarixini düzgün formatda daxil edin.";
            }
            else if (lang == "en")
            {
                ErrorMessage = "Doğum tarixini düzgün formatda daxil edin.";
            }
            ErrorMessagesTextbox(TxtBirthDate, ErrorMessage);
            return;
        }

        if (DListBirthPlace.SelectedValue == "-1")
        {
            if (lang == "az")
            {
                ErrorMessage = "Doğum yerini qeyd edin.";
            }
            else if (lang == "ru")
            {
                ErrorMessage = "Doğum yerini qeyd edin.";
            }
            else if (lang == "en")
            {
                ErrorMessage = "Doğum yerini qeyd edin.";
            }
            ErrorMessagesDropList(DListBirthPlace, ErrorMessage);
            return;
        }

        if (DListNationality.SelectedValue == "-1")
        {
            if (lang == "az")
            {
                ErrorMessage = "Vətəndaşlığı qeyd edin.";
            }
            else if (lang == "ru")
            {
                ErrorMessage = "Vətəndaşlığı qeyd edin.";
            }
            else if (lang == "en")
            {
                ErrorMessage = "Vətəndaşlığı qeyd edin.";
            }
            ErrorMessagesDropList(DListNationality, ErrorMessage);
            return;
        }

        if (string.IsNullOrEmpty(TxtMobileNumber.Text))
        {
            if (lang == "az")
            {
                ErrorMessage = "Əlaqə nömrəsini qeyd edin.";
            }
            else if (lang == "ru")
            {
                ErrorMessage = "Əlaqə nömrəsini qeyd edin.";
            }
            else if (lang == "en")
            {
                ErrorMessage = "Əlaqə nömrəsini qeyd edin.";
            }
            ErrorMessagesTextbox(TxtMobileNumber, ErrorMessage);
            return;
        }

        if (!Config.IsNumeric(TxtMobileNumber.Text))
        {
            if (lang == "az")
            {
                ErrorMessage = "Əlaqə nömrəsini düzgün formatda daxil edin.";
            }
            else if (lang == "ru")
            {
                ErrorMessage = "Əlaqə nömrəsini düzgün formatda daxil edin.";
            }
            else if (lang == "en")
            {
                ErrorMessage = "Əlaqə nömrəsini düzgün formatda daxil edin.";
            }
            ErrorMessagesTextbox(TxtMobileNumber, ErrorMessage);
            return;
        }

        if (string.IsNullOrEmpty(TxtEmail.Text))
        {
            if (lang == "az")
            {
                ErrorMessage = "Elektron ünvanı qeyd edin.";
            }
            else if (lang == "ru")
            {
                ErrorMessage = "Elektron ünvanı qeyd edin.";
            }
            else if (lang == "en")
            {
                ErrorMessage = "Elektron ünvanı qeyd edin.";
            }
            ErrorMessagesTextbox(TxtEmail, ErrorMessage);
            return;
        }

        if (!Config.IsEmail(TxtEmail.Text))
        {
            if (lang == "az")
            {
                ErrorMessage = "Elektron ünvanı düzgün formatda daxil edin.";
            }
            else if (lang == "ru")
            {
                ErrorMessage = "Elektron ünvanı düzgün formatda daxil edin.";
            }
            else if (lang == "en")
            {
                ErrorMessage = "Elektron ünvanı düzgün formatda daxil edin.";
            }
            ErrorMessagesTextbox(TxtEmail, ErrorMessage);
            return;
        }

        if (DListChildAge.SelectedValue == "-1")
        {
            if (lang == "az")
            {
                ErrorMessage = "Uşağın yaşını qeyd edin.";
            }
            else if (lang == "ru")
            {
                ErrorMessage = "Uşağın yaşını qeyd edin.";
            }
            else if (lang == "en")
            {
                ErrorMessage = "Uşağın yaşını qeyd edin.";
            }
            ErrorMessagesDropList(DListChildAge, ErrorMessage);
            return;
        }

        if (DListChildGender.SelectedValue == "-1")
        {
            if (lang == "az")
            {
                ErrorMessage = "Uşağın cinsini qeyd edin.";
            }
            else if (lang == "ru")
            {
                ErrorMessage = "Uşağın cinsini qeyd edin.";
            }
            else if (lang == "en")
            {
                ErrorMessage = "Uşağın cinsini qeyd edin.";
            }
            ErrorMessagesDropList(DListChildGender, ErrorMessage);
            return;
        }

        #endregion

        string GeneratedHtml = string.Format(LblName.Text.Replace(ImportantIcon, "") + TxtName.Text + "{0}" + LblSurname.Text.Replace(ImportantIcon, "") + TxtSurname.Text + "{0}" + LblPatronymic.Text + TxtPatronymic.Text +
                                             "{0}" + LblGender.Text.Replace(ImportantIcon, "") + DListGender.SelectedItem.Text + "{0}" + LblBirthDate.Text.Replace(ImportantIcon, "") + Config.DateFormatClear(TxtBirthDate.Text) +
                                             "{0}" + LblBirthPlace.Text.Replace(ImportantIcon, "") + DListBirthPlace.SelectedItem.Text + "{0}" + LblNationality.Text.Replace(ImportantIcon, "") + DListNationality.SelectedItem.Text +
                                             "{0}" + LblRegisteredAddress.Text.Replace(ImportantIcon, "") + TxtRegisteredAddress.Text + "{0}" + LblCurrentResidence.Text.Replace(ImportantIcon, "") + TxtCurrentResidence.Text +
                                             "{0}" + LblPhoneNumber.Text.Replace(ImportantIcon, "") + TxtPhoneNumber.Text + "{0}" + LblMobileNumber.Text.Replace(ImportantIcon, "") + TxtMobileNumber.Text +
                                             "{0}" + LblEmail.Text.Replace(ImportantIcon, "") + TxtEmail.Text + "{0}" + LblEducation.Text.Replace(ImportantIcon, "") + DListEducation.SelectedItem.Text +
                                             "{0}" + LblMarriedStatus.Text.Replace(ImportantIcon, "") + DListMarriedStatus.SelectedItem.Text + "<br/>" + "<strong>" + LtrSubTitle.Text + "</strong><br/>" +
                                             LblChildAge.Text.Replace(ImportantIcon, "") + DListChildAge.SelectedItem.Text + "{0}" + LblChildGender.Text.Replace(ImportantIcon, "") + DListChildGender.SelectedItem.Text +
                                             "{0}" + LblHealthStatus.Text.Replace(ImportantIcon, "") + DListHealthStatus.SelectedItem.Text + "{0}" + LblCause.Text.Replace(ImportantIcon, "") + TxtCause.Text, ",<br/>");
    }
Example #14
0
    protected void BtnSaveUsers_Click(object sender, EventArgs e)
    {
        // Əgər yeni istifadəçi əlavə edilirsə login passwordu yoxlayaq
        if (string.IsNullOrEmpty(BtnSaveUsers.CommandArgument))
        {
            TxtUsername.Text = TxtUsername.Text.Trim();

            if (TxtUsername.Text.Length < 4)
            {
                ShowModal();
                TxtUsername.Focus();
                Config.MsgBoxAjax("İstifadəçi adı minimum 4 simvoldan ibarət olmalıdır.", Page);
                return;
            }

            if (TxtUsername.Text.Length > 25)
            {
                ShowModal();
                TxtUsername.Focus();
                Config.MsgBoxAjax("İstifadəçi adı maksimum 25 simvoldan ibarət olmalıdır.", Page);
                return;
            }

            string LoginAllowChars = "qazwsxedcrfvtgbyhnujmikolpQAZWSXEDCRFVTGBYHNUJMIKOLP0123456789._";
            for (int i = 0; i < TxtUsername.Text.Length; i++)
            {
                //İlk və son simvollar ancaq rəqəm hərf olsun.
                if (i == 0)
                {
                    if (TxtUsername.Text.Substring(i, 1) == "." || TxtUsername.Text.Substring(i, 1) == "_")
                    {
                        ShowModal();
                        TxtUsername.Focus();
                        Config.MsgBoxAjax("İstifadəçi adının ilk simvolu rəqəm və ya hərf tipli olmalıdır.", Page);
                        return;
                    }
                }

                if (LoginAllowChars.IndexOf(TxtUsername.Text.Substring(i, 1)) < 0)
                {
                    ShowModal();
                    TxtUsername.Focus();
                    Config.MsgBoxAjax("İstifadəçi adının tərkibində yalnız rəqəm (0-9), hərf (a-z), nöqtə (.) və alt xətt (_) qəbul edilir.", Page);
                    return;
                }

                if (i == (TxtUsername.Text.Length - 1))
                {
                    if (TxtUsername.Text.Substring(i, 1) == "." || TxtUsername.Text.Substring(i, 1) == "_")
                    {
                        ShowModal();
                        TxtUsername.Focus();
                        Config.MsgBoxAjax("İstifadəçi adının son simvolu rəqəm və ya hərf tipli olmalıdır.", Page);
                        return;
                    }
                }
            }

            //Login varmı:
            string LoginCount = DALC.GetDbSingleValuesParams("Count(*)", "AdoptionAdministrators", "IsActive=1 and Username", TxtUsername.Text, "", "-1");

            //Əgər mənfi bir olarsa serverdə yüklənmə var.
            if (LoginCount == "-1")
            {
                ShowModal();
                Config.MsgBoxAjax(Config._DefaultSystemErrorMessages, Page);
                return;
            }

            //Əgər mənfi bir olmasa keçir bura və əgər sıfır deyilsə deməli bazada var 1 yada daha çoxdu
            if (LoginCount != "0")
            {
                ShowModal();
                Config.MsgBoxAjax("Bu istifadəçi adı artıq qeydiyyatdan keçirilib.", Page);
                return;
            }

            if (TxtPass.Text.Length < 4)
            {
                ShowModal();
                Config.MsgBoxAjax("İstifadəçi şifrəsi ən az 4 simvoldan ibarət olmalıdır.", Page);
                return;
            }
            if (TxtPass.Text.Length > 20)
            {
                ShowModal();
                Config.MsgBoxAjax("İstifadəçi şifrəsi maksimum 20 simvoldan ibarət olmalıdır.", Page);
                return;
            }
        }

        if (TxtFullname.Text.Length < 1)
        {
            ShowModal();
            Config.MsgBoxAjax("Soyadı, adı və atasının adını daxil edin.", Page);
            return;
        }

        if (!TxtEmail.Text.IsEmail())
        {
            ShowModal();
            Config.MsgBoxAjax("Elektron poçt ünvanını düzgün formatda daxil edin.", Page);
            return;
        }

        if (TxtContacts.Text.Trim().Length < 1)
        {
            ShowModal();
            Config.MsgBoxAjax("Telefon nömrəsini daxil edin.", Page);
            return;
        }

        if (!string.IsNullOrEmpty(BtnSaveUsers.CommandArgument))
        {
            Dictionary <string, object> DictUpdate = new Dictionary <string, object>();
            DictUpdate.Add("Username", TxtUsername.Text.Trim());
            DictUpdate.Add("Department", TxtDepartment.Text.Trim());
            DictUpdate.Add("Position", TxtPosition.Text.Trim());
            DictUpdate.Add("Fullname", TxtFullname.Text.Trim());
            DictUpdate.Add("Email", TxtEmail.Text.Trim());
            DictUpdate.Add("Contacts", TxtContacts.Text.Trim());
            DictUpdate.Add("PermissionIP", TxtPermissionIP.Text.Trim());
            DictUpdate.Add("AdoptionAdministratorsStatusID", int.Parse(DListPermissions.SelectedValue));
            DictUpdate.Add("Description", TxtDescription.Text.Trim());
            DictUpdate.Add("IsActive", ChkIsActive.Checked);
            DictUpdate.Add("Add_Dt", DateTime.Now);
            DictUpdate.Add("Add_Ip", Request.UserHostAddress.IPToInteger());
            DictUpdate.Add("WhereID", int.Parse(BtnSaveUsers.CommandArgument));

            int Chek = DALC.UpdateDatabase("AdoptionAdministrators", DictUpdate);
            if (Chek < 1)
            {
                ShowModal();
                Config.MsgBoxAjax(Config._DefaultSystemErrorMessages, Page);
                return;
            }

            DALC_Adoption.AdoptionAdministratorsHistoryInsert("İstifadəçinin məlumatları yeniləndi. AdminID: " + BtnSaveUsers.CommandArgument);
        }
        else
        {
            Dictionary <string, object> Dictionary = new Dictionary <string, object>();
            Dictionary.Add("Username", TxtUsername.Text.Trim());
            Dictionary.Add("Password", Config.SHA1Special(TxtPass.Text));
            Dictionary.Add("Department", TxtDepartment.Text.Trim());
            Dictionary.Add("Position", TxtPosition.Text.Trim());
            Dictionary.Add("Fullname", TxtFullname.Text.Trim());
            Dictionary.Add("Email", TxtEmail.Text.Trim());
            Dictionary.Add("Contacts", TxtContacts.Text.Trim());
            Dictionary.Add("PermissionIP", TxtPermissionIP.Text.Trim());
            Dictionary.Add("AdoptionAdministratorsStatusID", int.Parse(DListPermissions.SelectedValue));
            Dictionary.Add("Description", TxtDescription.Text.Trim());
            Dictionary.Add("IsActive", ChkIsActive.Checked);
            Dictionary.Add("Add_Dt", DateTime.Now);
            Dictionary.Add("Add_Ip", Request.UserHostAddress.IPToInteger());

            int AdminID = DALC.InsertDatabase("AdoptionAdministrators", Dictionary);
            if (AdminID < 1)
            {
                ShowModal();
                Config.MsgBoxAjax(Config._DefaultSystemErrorMessages, Page);
                return;
            }
            DALC_Adoption.AdoptionAdministratorsHistoryInsert("Yeni istifadəçi əlavə edildi. AdminID: " + AdminID.ToString());
        }

        LnkOtherApp_Click(null, null);
        Config.MsgBoxAjax("Əməliyyat uğurla yerinə yetirildi.", Page, true);
    }
Example #15
0
    private void BindData()
    {
        RptChilds.DataSource = null;
        RptChilds.DataBind();

        PnlSearch.BindControls(FilterDictionary, TableName);

        FilterDictionary = new Dictionary <string, object>()
        {
            { "Gender", DListGender.SelectedValue },
            { "GozColorsID", int.Parse(DListEyeColor.SelectedValue) },
            { "SachColorsID", int.Parse(DListHairColor.SelectedValue) },
            { "FLOOR(DATEDIFF(DAY , DogumTarixi ,GETDATE()) / 365.25)(BETWEEN)", DListAgeRange.SelectedValue }
        };

        if (DListBrotherSister.SelectedIndex != 0)
        {
            FilterDictionary.Add("IsBrotherSister", Convert.ToByte(DListBrotherSister.SelectedValue));
        }

        if (TxtFullname.Text.Length > 0)
        {
            FilterDictionary.Add("CONCAT(Soyad,' ',Ad,' ',Ata)(LIKE)", TxtFullname.Text);
        }

        int PageNum;
        int RowNumber = 3;

        if (!int.TryParse(Config._GetQueryString("pn"), out PageNum))
        {
            PageNum = 1;
        }

        HdnPageNumber.Value = PageNum.ToString();

        DALC.DataTableResult AdoptionPersonsResult = DALC_Adoption.GetAdoptionPersons(FilterDictionary, PageNum, RowNumber);

        if (AdoptionPersonsResult.Count == -1 || AdoptionPersonsResult.Dt == null)
        {
            Config.RedirectError();
            return;
        }

        if (AdoptionPersonsResult.Dt.Rows.Count < 1 && PageNum > 1)
        {
            Config.Redirect(string.Format("/e-services/adoption/?p=adoptionsite&pn={0}", PageNum - 1));
        }

        LblCount.Text = string.Format("Tapılıb: {0} anket", AdoptionPersonsResult.Count.ToString());

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

        HdnTotalCount.Value = Total_Count.ToString();

        PnlPager.Visible = AdoptionPersonsResult.Count > RowNumber;

        RptChilds.DataSource = AdoptionPersonsResult.Dt;
        RptChilds.DataBind();

        CheckControls();
    }