示例#1
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;
        }
    }
示例#2
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");
    }