Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DDLHelper.BindDDL(ref drpContinents, BINROTA.BUS.Subjects.GetSubjectForDDL((int)Enumerations.SubjectType.Kita), "Name", "SubjectID", "");
         imgSubjectPhoto.Attributes.Add("onerror", "this.src='Images/NoPictureForSubject.png';");
         UctrlImageUpload1.UploadType = Enumerations.FileUploadType.SubjectImages;
         ((Button)UctrlImageUpload1.FindControl("btnSend")).Visible = false;
         FillSubjectTree();
     }
 }
Exemplo n.º 2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.SaveMode == Enumerations.SaveMode.Update)
        {
            if (UctrlImageUpload1.FileName == "")
            {
                Subjects.SubjectsCountryUpdate(SubjectID, txtName.Text, txtDescription.Text, txtPhotoCaption.Text, SessRoot.UserID, txtLocation.Text, txtCapital.Text, txtArea.Text, txtNeighbourhood.Text, txtPopulation.Text, txtCurrency.Text, txtAreaCode.Text, txtTimeZone.Text, txtLanguage.Text, txtReligion.Text, int.Parse(drpContinents.SelectedValue));
            }
            else
            {
                UctrlImageUpload1.UploadType = Enumerations.FileUploadType.SubjectImages;
                Subjects.SubjectsCountryUpdate(SubjectID, txtName.Text, txtDescription.Text, UctrlImageUpload1.SendFile(Enumerations.SubjectType.Ulke.ToString() + "//" + txtName.Text), txtPhotoCaption.Text, SessRoot.UserID, txtLocation.Text, txtCapital.Text, txtArea.Text, txtNeighbourhood.Text, txtPopulation.Text, txtCurrency.Text, txtAreaCode.Text, txtTimeZone.Text, txtLanguage.Text, txtReligion.Text, int.Parse(drpContinents.SelectedValue));
            }

            LabelMessage.Text = "Ülke güncellenmiþtir";
            ModeControl();
        }
        else if (this.SaveMode == Enumerations.SaveMode.Insert)
        {
            Enumerations.SubjectInsertResult Result;
            Result = BINROTA.BUS.Subjects.SubjectsInsertCountry(txtName.Text, txtDescription.Text, UctrlImageUpload1.SendFile(Enumerations.SubjectType.Ulke.ToString() + "\\" + txtName.Text), txtPhotoCaption.Text, int.Parse(drpContinents.SelectedValue), (int)Enumerations.SubjectType.Ulke, DateTime.Now, SessRoot.UserID, txtLocation.Text, txtCapital.Text, txtArea.Text, txtNeighbourhood.Text, txtPopulation.Text, txtCurrency.Text, txtAreaCode.Text, txtTimeZone.Text, txtLanguage.Text, txtReligion.Text);
            if (Result == Enumerations.SubjectInsertResult.Success)
            {
                LabelMessage.Text = "Ülke eklenmiþtir";
            }
            else if (Result == Enumerations.SubjectInsertResult.AlreadyExist)
            {
                LabelMessage.Text = "Daha önce bu isimde bir ülke eklenmiþtir";
            }
            else if (Result == Enumerations.SubjectInsertResult.Failure)
            {
                LabelMessage.Text = "Ülke eklerken bir hata oluþtu. Lütfen tekrar deneyin";
            }
        }
        else
        {
            Common.GotoDefaultPage(this.Response);
        }
    }
Exemplo n.º 3
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.SaveMode == Enumerations.SaveMode.Update)
        {
            if (UctrlImageUpload1.FileName == "")
            {
                BINROTA.BUS.Subjects.SubjectsCityUpdate(SubjectID, txtName.Text, txtDescription.Text, txtPhotoCaption.Text, (drpRegion.Visible == true ? int.Parse(drpRegion.SelectedValue) : int.Parse(drpCountry.SelectedValue)), SessRoot.UserID);
            }
            else
            {
                BINROTA.BUS.Subjects.SubjectsCityUpdate(SubjectID, txtName.Text, txtDescription.Text, UctrlImageUpload1.SendFile(Enumerations.SubjectType.Sehir.ToString() + "\\" + txtName.Text), txtPhotoCaption.Text, (drpRegion.Visible == true ? int.Parse(drpRegion.SelectedValue) : int.Parse(drpCountry.SelectedValue)), SessRoot.UserID);
            }
            lbMessage.Text = "Þehir güncellenmiþtir";
        }
        else if (this.SaveMode == Enumerations.SaveMode.Insert)
        {
            Enumerations.SubjectInsertResult Result;
            Result = BINROTA.BUS.Subjects.SubjectsInsertCity(txtName.Text, txtDescription.Text, UctrlImageUpload1.SendFile(Enumerations.SubjectType.Sehir.ToString() + "\\" + txtName.Text), txtPhotoCaption.Text, (drpRegion.Visible == true ? int.Parse(drpRegion.SelectedValue) : int.Parse(drpCountry.SelectedValue)), (int)Enumerations.SubjectType.Sehir, DateTime.Now, SessRoot.UserID);
            if (Result == Enumerations.SubjectInsertResult.Success)
            {
                lbMessage.Text = "Þehir eklenmiþtir";
            }
            else if (Result == Enumerations.SubjectInsertResult.AlreadyExist)
            {
                lbMessage.Text = "Bu isimde bir þehir daha önceden eklenmiþ.";
            }
            else if (Result == Enumerations.SubjectInsertResult.Failure)
            {
                lbMessage.Text = "Þehir eklerken bir hata oluþtu. Lütfen tekrar deneyin";
            }
        }
        else
        {
            Common.GotoDefaultPage(this.Response);
        }
        DataTable dtSubject = BINROTA.BUS.Subjects.GetSubjectCity(SubjectID);

        BindSubject(dtSubject);
    }
Exemplo n.º 4
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (this.SaveMode == Enumerations.SaveMode.Update)
     {
         if (UctrlImageUpload1.FileName == "")
         {
             BINROTA.BUS.Subjects.SubjectsUpdate(SubjectID, txtName.Text, txtDescription.Text, txtPhotoCaption.Text, SessRoot.UserID);
         }
         else
         {
             BINROTA.BUS.Subjects.SubjectsUpdate(SubjectID, txtName.Text, txtDescription.Text, UctrlImageUpload1.SendFile(Enumerations.SubjectType.Kita.ToString() + "\\" + txtName.Text), txtPhotoCaption.Text, SessRoot.UserID);
         }
         lbMessage.Text = "Kýta güncellenmiþtir";
     }
     else if (this.SaveMode == Enumerations.SaveMode.Insert)
     {
         Enumerations.SubjectInsertResult Result;
         Result = BINROTA.BUS.Subjects.SubjectsInsertContinent(txtName.Text, txtDescription.Text, UctrlImageUpload1.SendFile(Enumerations.SubjectType.Kita.ToString() + "\\" + txtName.Text), txtPhotoCaption.Text, (int)Enumerations.SubjectType.Kita, DateTime.Now, SessRoot.UserID);
         if (Result == Enumerations.SubjectInsertResult.Success)
         {
             lbMessage.Text = "Kýta eklenmiþtir";
         }
         else if (Result == Enumerations.SubjectInsertResult.AlreadyExist)
         {
             lbMessage.Text = "Bu isimde bir kýta zaten var";
         }
         else if (Result == Enumerations.SubjectInsertResult.Failure)
         {
             lbMessage.Text = "Kýta eklerken bir hata oluþtu. Lütfen tekrar deneyin";
         }
     }
     else
     {
         Common.GotoDefaultPage(this.Response);
     }
 }
Exemplo n.º 5
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        int SubjectID = int.Parse(tvSubjects.SelectedNode.Value);

        switch (this.SubjectType)
        {
        case Enumerations.SubjectType.Kita:
            if (this.SaveMode == Enumerations.SaveMode.Update)
            {
                if (UctrlImageUpload1.FileName == "")
                {
                    BINROTA.BUS.Subjects.SubjectsUpdate(SubjectID, txtName.Text, txtDescription.Text, txtPhotoCaption.Text, 5);
                }
                else
                {
                    BINROTA.BUS.Subjects.SubjectsUpdate(SubjectID, txtName.Text, txtDescription.Text, UctrlImageUpload1.SendFile(Enumerations.SubjectType.Kita.ToString() + "//" + txtName.Text), txtPhotoCaption.Text, 5);
                }
                lbMessage.Text = "Kýta güncellenmiþtir";
            }
            else if (this.SaveMode == Enumerations.SaveMode.Insert)
            {
                Enumerations.SubjectInsertResult Result;
                Result = BINROTA.BUS.Subjects.SubjectsInsertContinent(txtName.Text, txtDescription.Text, UctrlImageUpload1.SendFile(Enumerations.SubjectType.Kita.ToString() + "//" + txtName.Text), txtPhotoCaption.Text, (int)Enumerations.SubjectType.Kita, DateTime.Now, 5);
                if (Result == Enumerations.SubjectInsertResult.Success)
                {
                    lbMessage.Text = "Kýta eklenmiþtir";
                }
                else if (Result == Enumerations.SubjectInsertResult.AlreadyExist)
                {
                    lbMessage.Text = "Bu isimde bir kýta zaten var";
                }
                else if (Result == Enumerations.SubjectInsertResult.Failure)
                {
                    lbMessage.Text = "Kýta eklerken bir hata oluþtu. Lütfen tekrar deneyin";
                }
            }
            else
            {
                Common.GotoDefaultPage(this.Response);
            }
            break;

        case Enumerations.SubjectType.Ulke:
            if (this.SaveMode == Enumerations.SaveMode.Update)
            {
                if (UctrlImageUpload1.FileName == "")
                {
                    BINROTA.BUS.Subjects.SubjectsCountryUpdate(SubjectID, txtName.Text, txtDescription.Text, txtPhotoCaption.Text, 5, txtLocation.Text, txtCapital.Text, txtArea.Text, txtNeighbourhood.Text, txtPopulation.Text, txtCurrency.Text, txtAreaCode.Text, txtTimeZone.Text, txtLanguage.Text, txtReligion.Text, int.Parse(drpContinents.SelectedValue));
                }
                else
                {
                    UctrlImageUpload1.UploadType = Enumerations.FileUploadType.SubjectImages;
                    BINROTA.BUS.Subjects.SubjectsCountryUpdate(SubjectID, txtName.Text, txtDescription.Text, UctrlImageUpload1.SendFile(Enumerations.SubjectType.Ulke.ToString() + "//" + txtName.Text), txtPhotoCaption.Text, 5, txtLocation.Text, txtCapital.Text, txtArea.Text, txtNeighbourhood.Text, txtPopulation.Text, txtCurrency.Text, txtAreaCode.Text, txtTimeZone.Text, txtLanguage.Text, txtReligion.Text, int.Parse(drpContinents.SelectedValue));
                }

                lbMessage.Text = "Ülke güncellenmiþtir";
            }
            else if (this.SaveMode == Enumerations.SaveMode.Insert)
            {
                Enumerations.SubjectInsertResult Result;
                Result = BINROTA.BUS.Subjects.SubjectsInsertCountry(txtName.Text, txtDescription.Text, UctrlImageUpload1.SendFile(Enumerations.SubjectType.Ulke.ToString() + "//" + txtName.Text), txtPhotoCaption.Text, int.Parse(drpContinents.SelectedValue), (int)Enumerations.SubjectType.Ulke, DateTime.Now, 5, txtLocation.Text, txtCapital.Text, txtArea.Text, txtNeighbourhood.Text, txtPopulation.Text, txtCurrency.Text, txtAreaCode.Text, txtTimeZone.Text, txtLanguage.Text, txtReligion.Text);
                if (Result == Enumerations.SubjectInsertResult.Success)
                {
                    lbMessage.Text = "Ülke eklenmiþtir";
                }
                else if (Result == Enumerations.SubjectInsertResult.AlreadyExist)
                {
                    lbMessage.Text = "Daha önce bu isimde bir ülke eklenmiþtir";
                }
                else if (Result == Enumerations.SubjectInsertResult.Failure)
                {
                    lbMessage.Text = "Ülke eklerken bir hata oluþtu. Lütfen tekrar deneyin";
                }
            }
            else
            {
                Common.GotoDefaultPage(this.Response);
            }
            break;

        case Enumerations.SubjectType.Sehir:
            if (this.SaveMode == Enumerations.SaveMode.Update)
            {
                if (UctrlImageUpload1.FileName == "")
                {
                    BINROTA.BUS.Subjects.SubjectsCityUpdate(SubjectID, txtName.Text, txtDescription.Text, txtPhotoCaption.Text, int.Parse(drpCountries.SelectedValue), 5);
                }
                else
                {
                    BINROTA.BUS.Subjects.SubjectsCityUpdate(SubjectID, txtName.Text, txtDescription.Text, UctrlImageUpload1.SendFile(Enumerations.SubjectType.Sehir.ToString() + "//" + txtName.Text), txtPhotoCaption.Text, int.Parse(drpCountries.SelectedValue), 5);
                }
                lbMessage.Text = "Þehir güncellenmiþtir";
            }
            else if (this.SaveMode == Enumerations.SaveMode.Insert)
            {
                Enumerations.SubjectInsertResult Result;
                Result = BINROTA.BUS.Subjects.SubjectsInsertCity(txtName.Text, txtDescription.Text, UctrlImageUpload1.SendFile(Enumerations.SubjectType.Sehir.ToString() + "//" + txtName.Text), txtPhotoCaption.Text, int.Parse(drpCountries.SelectedValue), (int)Enumerations.SubjectType.Sehir, DateTime.Now, 5);
                if (Result == Enumerations.SubjectInsertResult.Success)
                {
                    lbMessage.Text = "Þehir eklenmiþtir";
                }
                else if (Result == Enumerations.SubjectInsertResult.AlreadyExist)
                {
                    lbMessage.Text = "Bu isimde bir þehir daha önceden eklenmiþ.";
                }
                else if (Result == Enumerations.SubjectInsertResult.Failure)
                {
                    lbMessage.Text = "Þehir eklerken bir hata oluþtu. Lütfen tekrar deneyin";
                }
            }
            else
            {
                Common.GotoDefaultPage(this.Response);
            }
            break;
        }
    }