示例#1
0
    protected void DVReligion_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
    {
        DataRowView  row           = (DataRowView)((DetailsView)sender).DataItem;
        DropDownList ddlReligion   = (DropDownList)((DetailsView)sender).FindControl("ddlReligion");
        DropDownList ddlCast       = (DropDownList)((DetailsView)sender).FindControl("ddlCast");
        DropDownList ddlRashi      = (DropDownList)((DetailsView)sender).FindControl("ddlRashi");
        DropDownList ddlStar       = (DropDownList)((DetailsView)sender).FindControl("ddlStar");
        TextBox      txtCastOther1 = DVReligion.Rows[1].Cells[1].Controls[3] as TextBox;
        TextBox      txtCastOther  = (TextBox)((DetailsView)sender).FindControl("txtCastOther");
        TextBox      txtDosham     = (TextBox)((DetailsView)sender).FindControl("txtDosham");
        TextBox      txtGothram    = (TextBox)((DetailsView)sender).FindControl("txtGothram");

        BAL.Comunity_Id = ddlReligion.SelectedValue;
        BAL.Star        = ddlStar.SelectedValue;
        BAL.Rashi       = ddlRashi.SelectedValue;
        BAL.Dosham      = txtDosham.Text.Trim();
        BAL.Gothram     = txtGothram.Text.Trim();
        BAL.Gender      = Session["uid_gender"].ToString().Split('_')[1];
        BAL.Id          = Session["Bride_groom_Id"].ToString();

        if (ddlCast.SelectedValue == "Others")
        {
            if (txtCastOther.Text == "")
            {
                WebMsgBox.Show("Please Enter New Cast");
                txtCastOther.Focus();
            }
            else if (DataBindig.CheckCast(txtCastOther.Text.Trim()))
            {
                WebMsgBox.Show("New Cast Is Already Exist Please Select From List");
                txtCastOther.Visible = false;
                txtCastOther.Text    = "";
                ddlCast.Focus();
            }
            else
            {
                BAL.Cast_Id = txtCastOther.Text.Trim();
                DataBindig.AddNewCast(txtCastOther.Text.Trim().ToLowerInvariant(), ddlReligion.SelectedValue);
                WebMSG(DalProfile.UpdateReligiousDetail(BAL));

                DVReligion.ChangeMode(DetailsViewMode.ReadOnly);
                LoadReligion();
            }
        }
        else
        {
            BAL.Cast_Id = ddlCast.SelectedValue;
            WebMSG(DalProfile.UpdateReligiousDetail(BAL));

            DVReligion.ChangeMode(DetailsViewMode.ReadOnly);
            LoadReligion();
        }
    }
示例#2
0
 protected void NewCast()
 {
     if (DataBindig.CheckCast(txtOther.Text.Trim()))
     {
         if (txtOther.Text == "")
         {
             WebMsgBox.Show("Please Enter New Cast");
             txtOther.Focus();
         }
         else if (DataBindig.CheckCast(txtOther.Text.Trim()))
         {
             WebMsgBox.Show("New Cast Is Already Exist Please Select From List");
             txtOther.Visible = false;
             txtOther.Text    = "";
             txtOther.Focus();
         }
         else
         {
             BALuser.Cast_Id = txtOther.Text.Trim();
             DataBindig.AddNewCast(txtOther.Text.Trim().ToLowerInvariant(), ddlReligion.SelectedValue);
         }
     }
 }