public void SaveVenueContactPerson(Int32 VenueID)
 {
     saveTempcontactperson();
     DataTable dt = (DataTable)ViewState["temptable"];
     Int32 personalid;
     if (dt.Rows.Count > 0)
     {
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             if (Convert.ToInt32(dt.Rows[i]["contactpersonid"]) == 0)
             {
                 personalid = Convert.ToInt32(dt.Rows[i]["personalid"]);
                 VenueDataLayer.VenueData objven = new VenueDataLayer.VenueData();
                 objven.VenueContactperson_Insert(VenueID, personalid);
             }
         }
     }
 }
Exemplo n.º 2
0
        public void SaveData()
        {
            CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
            TextInfo textInfo = cultureInfo.TextInfo;
            PersonalData objper = new PersonalData();
            string fname, mname, lname, company, employeetype, materialstatus, empstatus, phoneland, phoncell, phoneother, fax, email, webpage, facebook, twitter;
            string residstaddress, otherstaddress, homezip, otherzip;
            Nullable<Int32> residcityid = null, othercityid = null;
            Nullable<Int16> titleid = null;
            Nullable<DateTime> dateifhire = null, terminationdate = null, dob = null;
            othercityid = ucothercity.InsertCitydetails();
            residcityid = ucresidcity.InsertCitydetails();
            fname = textInfo.ToTitleCase(txtfirstname.Text.Trim());
            mname = textInfo.ToTitleCase(txtmiddlename.Text.Trim());
            lname = textInfo.ToTitleCase(txtlastname.Text.Trim());
            company = textInfo.ToTitleCase(txtcompany.Text.Trim());
            employeetype = ddlemployeetype.SelectedItem.Text.Trim();
            materialstatus = txtmaterialstatus.Text.Trim();
            empstatus = ddlemployeestatus.SelectedItem.Text;// txtemployeestatus.Text.Trim();
            phoneland = txtphoneland.Text.Trim();
            phoncell = txtphonecell.Text.Trim();
            phoneother = txtphoneother.Text.Trim();
            fax = txtfax.Text.Trim();
            email = txtemail.Text.Trim();
            webpage = txtwebpage.Text.Trim();
            facebook = txtfacebook.Text.Trim();
            twitter = txttwitter.Text.Trim();

            titleid = (ddltitle.SelectedIndex == 0) ? titleid : Convert.ToInt16(ddltitle.SelectedItem.Value);

            dateifhire = (txtdateifhire.Text.Trim() == "") ? dateifhire : Convert.ToDateTime(txtdateifhire.Text);
            terminationdate = (txttermanitationdate.Text.Trim() == "") ? terminationdate : Convert.ToDateTime(txttermanitationdate.Text);
            dob = (txtdob.Text.Trim() == "") ? dob : Convert.ToDateTime(txtdob.Text);
            TextBox txtresidaddress = (TextBox)ucresidcity.FindControl("txtaddress");
            TextBox txtotheraddress = (TextBox)ucothercity.FindControl("txtaddress");
            residstaddress = textInfo.ToTitleCase(txtresidaddress.Text.Trim());
            otherstaddress = textInfo.ToTitleCase(txtotheraddress.Text.Trim());
            //homezip = (ucresidcity.FindControl("txtzipcode") as TextBox).Text;
            //otherzip = (ucothercity.FindControl("txtzipcode") as TextBox).Text;
            homezip = ucresidcity.Get_child_zipcode();
            otherzip = ucothercity.Get_child_zipcode();

            Int32 personalid = 0;
            //string msg = "",
            string type = "I";
            if (string.IsNullOrEmpty(Request.QueryString["personalid"]))
            {
                personalid = objper.Personaldata_Insert(fname, mname, lname, company, employeetype, materialstatus, empstatus, phoneland, phoncell, phoneother, fax, email, webpage, facebook, twitter, residstaddress, residcityid, otherstaddress, othercityid, titleid, dateifhire, terminationdate, dob, homezip, otherzip);
            }
            else if (Request.QueryString["personalid"] != "" && Request.QueryString["personalid"] != null)
            {
                personalid = Convert.ToInt32(Request.QueryString["personalid"]);
                objper.Personaldata_Update(personalid, fname, mname, lname, company, employeetype, materialstatus, empstatus, phoneland, phoncell, phoneother, fax, email, webpage, facebook, twitter, residstaddress, residcityid, otherstaddress, othercityid, titleid, dateifhire, terminationdate, dob, homezip, otherzip);
                type = "U";
            }
            if (personalid < 0)
            {
                lblerrmsg.Text = "Error: Data did not submit. Please contact system administrator!";
                lblerrmsg.ForeColor = System.Drawing.Color.Red;
            }
            else if (personalid > 0)
            {
                ucshow.SavePersonalShow(personalid);
                ucdocx.SaveDocx(personalid, "PERSONAL");
                ucshow.showhidefooter(false);
                if (string.IsNullOrEmpty(Request.QueryString["form"]) == true)
                {
                    Response.Redirect("~/personal.aspx?personalid=" + personalid.ToString() + "&type=" + type + "");
                }
                else
                {
                    string prev_form = Request.QueryString["form"];
                    Int32 pre_or_ven_id = Convert.ToInt32(prev_form.Split('_').GetValue(1));
                    string pre_or_ven_flg = Convert.ToString(prev_form.Split('_').GetValue(0));
                    if (pre_or_ven_flg == "p")
                    {
                        objpre.PresenterContactperson_Insert(pre_or_ven_id, personalid);
                        Response.Redirect("~/presenter.aspx?presenterid=" + pre_or_ven_id.ToString() + "&type=I");
                    }
                    if (pre_or_ven_flg == "v")
                    {
                        VenueDataLayer.VenueData objven = new VenueDataLayer.VenueData();
                        objven.VenueContactperson_Insert(pre_or_ven_id, personalid);
                        Response.Redirect("~/venue.aspx?venueid=" + pre_or_ven_id.ToString() + "&type=I");
                    }

                }
            }
        }
 public void LoadVenueContactpersondetails(Int32 VenueID)
 {
     hdntype.Value = "VENUE";
     hdnvenueid.Value = VenueID.ToString();
     hdnpresenterid.Value = "0";
     VenueDataLayer.VenueData objven = new VenueDataLayer.VenueData();
     DataTable dt = objven.GetVenuePersonalDetails(VenueID);
     DataColumn dc = new DataColumn();
     dc.ColumnName = "tempid";
     dc.DataType = typeof(int);
     dc.AutoIncrement = true;
     dc.AutoIncrementSeed = 1;
     dt.Columns.Add(dc);
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         dt.Rows[i]["tempid"] = i + 1;
     }
     ViewState["temptable"] = dt;
     bindcontactperson();
     Panel pnlfooter = RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("pnlfooter") as Panel;
     pnlfooter.Visible = false;
 }