public void DeleteData(string flag)
 {
     PresenterData objpres = new PresenterData();
     Int32 presenterid = Convert.ToInt32(hdnpresenterid.Value);
     string msg = objpres.Presenter_Delete(presenterid, flag);
     if (msg == "")
     {
         divmsg.InnerHtml = (flag == "n") ? "Record deleted successfully!" : "Record undeleted successfully!";
         (this.Master as Site1).show_control(flag, pnlpresenter);
     }
     else
     {
         lblerrmsg.Text = msg;
     }
 }
 public static List<string> Getpresentername(string prefixText)
 {
     PresenterData objpres = new PresenterData();
     List<string> Presentername = objpres.SearchPresentername(prefixText, "Y");
     return Presentername;
 }
 public void SaveData()
 {
     CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
     TextInfo textInfo = cultureInfo.TextInfo;
     string presentername = "", presenterstreet = "", notes = "", zip;
     Nullable<Int32> cityid = null;
     presentername = textInfo.ToTitleCase(txtpresentername.Text.Trim());
     TextBox txtaddress = (TextBox)uccity.FindControl("txtaddress");
     presenterstreet = textInfo.ToTitleCase(txtaddress.Text.Trim());
     notes = txtnotes.Text.Trim();
     cityid = uccity.InsertCitydetails();
     PresenterData objpres = new PresenterData();
     Int32 presenterid = 0;
     //zip = (uccity.FindControl("txtzipcode") as TextBox).Text;
     zip = uccity.Get_child_zipcode();
     //string msg = "";
     if (string.IsNullOrEmpty(Request.QueryString["presenterid"]))
     {
         if (hdnpresenterid.Value == "0")
         {
             presenterid = objpres.PresenterDetails_Insert(presentername, presenterstreet, cityid, notes, zip);
             if (presenterid == 0)
             {
                 lblerrmsg.Text = "Presenter already exists!";
             }
             else
            {
                 hdnpresenterid.Value = presenterid.ToString();
                 uccontactperson.SavePresenterContactPerson(presenterid);
                 ucdocx.SaveDocx(presenterid, "PRESENTER");
                 if (Convert.ToString(ViewState["status"]) == "")
                     Response.Redirect("~/presenter.aspx?presenterid=" + presenterid.ToString() + "&type=I");
             }
         }
         else
         {
             lblerrmsg.Text = "Presenter already exists!";
         }
     }
     else if (!string.IsNullOrEmpty(Request.QueryString["presenterid"]))
     {
         presenterid = Convert.ToInt32(Request.QueryString["presenterid"]);
         hdnpresenterid.Value = presenterid.ToString();
         int existid = 0;
         existid = objpres.PresenterDetails_Update(presenterid, presentername, presenterstreet, cityid, notes, zip);
         if (existid == 0)
         {
             uccontactperson.SavePresenterContactPerson(presenterid);
             ucdocx.SaveDocx(presenterid, "PRESENTER");
             if (Convert.ToString(ViewState["status"]) == "")
             divmsg.InnerHtml = "Records updated successfully!";
             uccontactperson.showhidefooter(false);
         }
         else { lblerrmsg.Text = "Presenter already exist!"; }
     }
 }
 public static List<string> Getphone(string prefixText, string contextKey)
 {
     PresenterData objpres = new PresenterData();
     List<string> personal = objpres.searchpersonal(contextKey, prefixText, "P", "Y");
     return personal;
 }
 public void LoadContactpersondetails(Int32 presenterid)
 {
     hdntype.Value = "PRESENTER";
     hdnpresenterid.Value = presenterid.ToString();
     hdnvenueid.Value = "0";
     PresenterData objpres = new PresenterData();
     DataTable dt = objpres.GetPresenterPersonalDetails(presenterid);
     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();
     showhidefooter(false);
 }
        public void loadpresenterdetails()
        {
            try
            {
                Int32 presenterid = Convert.ToInt32(hdnpresenterid.Value);
                PresenterData objpres = new PresenterData();
                DataTable dt = objpres.GetPresenterDetails(presenterid);
                if (dt.Rows.Count > 0)
                {

                       lblHeader.Visible = true;
                       lblHeader.Text= dt.Rows[0]["PRESENTER_NAME"].ToString();

                    txtpresentername.Text = dt.Rows[0]["PRESENTER_NAME"].ToString();
                    txtnotes.Text = dt.Rows[0]["PRESENTER_NOTES"].ToString();
                    (uccity.FindControl("txtzipcode") as TextBox).Text = dt.Rows[0]["zip"].ToString().Trim();
                    string City_Zip = dt.Rows[0]["zip"].ToString();
                    uccity.fillcitydetails(Convert.ToInt32(dt.Rows[0]["PRESENTER_CITY_ID"]), dt.Rows[0]["PRESENTER_STREET"].ToString(), City_Zip);
                    string active_flag = dt.Rows[0]["PRESENTER_ACTIVE_FLAG"].ToString();
                    string beast_flag = dt.Rows[0]["presenter_beast_flag"].ToString();
                    (this.Master as Site1).show_control(active_flag, pnlpresenter, beast_flag);
                    if (!string.IsNullOrEmpty(Request.QueryString["presenterid"]))
                    {
                        ucdocx.GetDocxDetails(presenterid, "PRESENTER");
                        uccontactperson.LoadContactpersondetails(presenterid);
                        uccontactperson.showhidefooter(false);
                    }
                }
            }
            catch (Exception ex)
            {
                lblerrmsg.Text = "Error: " + ex.Message.ToString();
                lblerrmsg.ForeColor = System.Drawing.Color.Red;
            }
        }
 //protected void ddltitle_SelectedIndexChanged(object sender, EventArgs e)
 //{
 //    DropDownList ddlfirstname = (DropDownList)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("ddlfirstname");
 //    DropDownList ddltitle = (DropDownList)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("ddltitle");
 //    Label lblfax = (Label)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("lblfax");
 //    Label lblemail = (Label)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("lblemail");
 //    Label lblphone = (Label)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("lblphone");
 //    TextBox txtfirstname = (TextBox)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("txtfirstname");
 //    DropDownList ddllastname = (DropDownList)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("ddllastname");
 //    AjaxControlToolkit.AutoCompleteExtender acefirstname = (AjaxControlToolkit.AutoCompleteExtender)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("acefirstname");
 //    acefirstname.ContextKey = ddltitle.SelectedValue;
 //    txtfirstname.Text = string.Empty;
 //    ListItem li = ddllastname.Items[0];
 //    ddllastname.Items.Clear();
 //    ddllastname.Items.Add(li);
 //    lblfax.Text = string.Empty;
 //    lblemail.Text = string.Empty;
 //    lblphone.Text = string.Empty;
 //    loadPersonalFirstName();
 //}
 protected void txtfirstname_TextChanged(object sender, EventArgs e)
 {
     DropDownList ddllastname = (DropDownList)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("ddllastname");
     TextBox txtfirstname = (TextBox)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("txtfirstname");
     ddllastname.Focus();
     PresenterData objpres = new PresenterData();
     DataTable dt = objpres.GetPersonalName(txtfirstname.Text, "", "L", "Y");
     CommonFun objcf = new CommonFun();
     objcf.FillDropDownList(ddllastname, dt, "PERSONAL_FNAME", "PERSONAL_ID");
     if (dt.Rows.Count == 1)
     {
         ddllastname.SelectedIndex = 1;
         hdnfirstnameid.Value = ddllastname.SelectedItem.Value;
         loadphonedetails();
         setneweditlink();
     }
     setneweditlink();
 }
 public void SavePresenterContactPerson(Int32 presenterid)
 {
     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"]);
                 PresenterData objpres = new PresenterData();
                 objpres.PresenterContactperson_Insert(presenterid, personalid);
             }
         }
     }
 }
        public void loadPersonalLastName()
        {
            DropDownList ddlfirstname = (DropDownList)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("ddlfirstname");
            DropDownList ddllastname = (DropDownList)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("ddllastname");
            PresenterData objpres = new PresenterData();
            DataTable dt = objpres.GetPersonalName(ddlfirstname.SelectedItem.Text, "", "L", "Y");

            CommonFun objcf = new CommonFun();
            objcf.FillDropDownList(ddllastname, dt, "PERSONAL_FNAME", "PERSONAL_ID");
            if (dt.Rows.Count == 1)
            {
                ddllastname.SelectedIndex = 1;
                hdnfirstnameid.Value = ddllastname.SelectedItem.Value;
            }
            loadphonedetails();
            ddllastname.Focus();
        }
 public void loadPersonalFirstName()
 {
     //DropDownList ddltitle = (DropDownList)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("ddltitle");
     DropDownList ddlfirstname = (DropDownList)RepDetails.Controls[RepDetails.Controls.Count - 1].FindControl("ddlfirstname");
     PresenterData objpres = new PresenterData();
     dt = objpres.GetPersonalName(null, "", "F", "Y");
     objcf.FillDropDownList(ddlfirstname, dt, "PERSONAL_FNAME", "PERSONAL_ID");
 }
Beispiel #11
0
 public static List<string> Getpersonalname(string prefixText)
 {
     PresenterData objpres = new PresenterData();
     List<string> personal = objpres.searchpersonal("", prefixText, "F", "Y");
     return personal;
 }