protected void BtnSave_Click(object sender, EventArgs e)
    {
        //admin olub olmadigin yoxlayaq
        if (DALC._GetAdministratorsLogin.UsersStatusID != 30 && DALC._GetAdministratorsLogin.UsersStatusID != 25)
        {
            return;
        }

        if (DlistRegionalCenter.SelectedValue == "-1")
        {
            Config.MsgBoxAjax("Regional mərkəzi daxil edin.");
            ShowPopup();
            return;
        }
        if (DListSubOrganization.SelectedValue == "-1")
        {
            Config.MsgBoxAjax("Qurumu daxil edin.");
            ShowPopup();
            return;
        }
        if (DlistVisitType.SelectedValue == "-1")
        {
            Config.MsgBoxAjax("Başçəkmənin formasını daxil edin.");
            ShowPopup();
            return;
        }
        if (string.IsNullOrEmpty(TxtProblems.Text.Trim()))
        {
            Config.MsgBoxAjax("Aşkar edilmiş problemləri daxil edin.");
            ShowPopup();
            return;
        }
        if (string.IsNullOrEmpty(TxtSuggestion.Text.Trim()))
        {
            Config.MsgBoxAjax("Tövsiyəni daxil edin.");
            ShowPopup();
            return;
        }

        object DtVisit = TxtVisitDate.Text.DateTimeFormat();

        if (DtVisit == null)
        {
            Config.MsgBoxAjax("Baxışın həyata keçirildiyi tarixi düzgün seçin.");
            ShowPopup();
            return;
        }


        int result = -1;

        if (ViewState["operation"]._ToString() == "new")
        {
            result = DALC.InsertAuditsOrganizations(
                DALC._GetAdministratorsLogin.ID,
                DlistRegionalCenter.SelectedValue,
                DListSubOrganization.SelectedValue,
                DlistVisitType.SelectedValue,
                TxtProblems.Text,
                TxtSuggestion.Text,
                TxtDescription.Text, (DateTime)DtVisit);
        }

        else if (ViewState["operation"]._ToString() == "edit")
        {
            result = DALC.UpdateAuditOrganizations(ViewState["AuditsOrganizationsID"]._ToString(), DlistRegionalCenter.SelectedValue, DListSubOrganization.SelectedValue,
                                                   DlistVisitType.SelectedValue, TxtProblems.Text, TxtSuggestion.Text, TxtDescription.Text, (DateTime)DtVisit);
        }

        if (result > 0)
        {
            int AuditsOrganizationsID = ViewState["operation"]._ToString() == "new" ? result : ViewState["AuditsOrganizationsID"]._ToInt32();

            //Duzgun update oluna bilmesi ucun her ehtimala qarsi bu AuditsOrganizations-a aid butun userleri evvelce silib sonra tezden insert edek
            if (ViewState["operation"]._ToString() == "edit")
            {
                DALC.DeleteAuditsOrganizationsUsers(AuditsOrganizationsID);
            }

            if (DlistUsers.GetSelectedIndices().Count() > 0)
            {
                for (int i = 0; i <= (DlistUsers.Items.Count - 1); i++)
                {
                    if (DlistUsers.Items[i].Selected)
                    {
                        string SelectedUserId = DlistUsers.Items[i].Value;

                        DALC.InsertAuditsOrganizationsUsers(AuditsOrganizationsID, SelectedUserId._ToInt32());
                    }
                }
            }

            Config.MsgBoxAjax(ViewState["operation"]._ToString() == "new" ? "Məlumatlar qeydə alındı." : "Məlumatlar redaktə edildi.", true);
            BindGrid();
        }
        else
        {
            Config.MsgBoxAjax(Config._DefaultErrorMessages);
        }
    }