Example #1
0
 public void DeleteData(string flag)
 {
     ShowData objshow = new ShowData();
     Int32 showid = Convert.ToInt32(hdnshowid.Value);
     string msg = objshow.Show_Delete(showid, flag);
     if (msg == "")
     {
         divmsg.InnerHtml = (flag == "n") ? "Record deleted successfully!" : "Record undeleted successfully!";
         (this.Master as Site1).show_control(flag, pnlshow);
     }
     else
     {
         lblerrmsg.Text = msg;
     }
 }
Example #2
0
 public static List<string> Getshownames(string prefixText)
 {
     ShowData edl = new ShowData();
     List<string> shows = edl.searchdata(prefixText, "0");
     return shows;
 }
Example #3
0
        public void loadshowdetails()
        {
            try
            {
                DataTable dt = new DataTable();
                ShowData objshow = new ShowData();
                dt = objshow.Getshowdetails(hdnshowid.Value);
                if (dt.Rows.Count > 0)
                {

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

                    txtshowname.Text = dt.Rows[0]["show_name"].ToString();
                    txtfederalid.Text = dt.Rows[0]["show_fed_id"].ToString();
                    if (dt.Rows[0]["show_wkly_operating_expense"] != DBNull.Value)
                        txtwklyopexp.Text = Convert.ToDecimal(dt.Rows[0]["show_wkly_operating_expense"]).ToString("N2", new CultureInfo("en-US"));
                    if (dt.Rows[0]["show_overhead_nut"] != DBNull.Value)
                        txtoverheadnut.Text = Convert.ToDecimal(dt.Rows[0]["show_overhead_nut"]).ToString("N2", new CultureInfo("en-US"));
                    txtname.Text = dt.Rows[0]["show_corp_name"].ToString();
                    hdncityid.Value = dt.Rows[0]["CITY_ID"].ToString();
                    txtvariableroyalities.Text = dt.Rows[0]["show_var_rolyalties"].ToString();
                    txtshowbegindate.Text = dt.Rows[0]["show_begin_dt"].ToString();
                    (uccity.FindControl("txtzipcode") as TextBox).Text = dt.Rows[0]["zip"].ToString().Trim();
                    string active_flag = dt.Rows[0]["SHOW_ACTIVE_FLAG"].ToString();
                    string show_beast_flag = dt.Rows[0]["show_beast_flag"].ToString();
                    string City_Zip = dt.Rows[0]["zip"].ToString();
                    (this.Master as Site1).show_control(active_flag, pnlshow, show_beast_flag);
                    uccity.fillcitydetails(Convert.ToInt32(dt.Rows[0]["CITY_ID"]), dt.Rows[0]["show_corp_street"].ToString(), City_Zip);
                    hdnshowname.Value = dt.Rows[0]["show_name"].ToString();
                    ddlcompanymgr.SelectedIndex = ddlcompanymgr.Items.IndexOf(ddlcompanymgr.Items.FindByValue(Convert.ToString(dt.Rows[0]["COMPANYMGR_ID"].ToString().ToLower())));
                    if (!string.IsNullOrEmpty(Request.QueryString["showid"]))
                    {
                        Int32 showid = Convert.ToInt32(hdnshowid.Value);
                        ucdocx.GetDocxDetails(showid, "SHOW");

                    }

                }
            }
            catch (Exception ex)
            {
                lblerrmsg.Text = "Error: " + ex.Message.ToString();
                lblerrmsg.ForeColor = System.Drawing.Color.Red;
            }
        }
Example #4
0
        public void SaveData()
        {
            if (validate_prefshow() == true)
            {
                char[] chDlr = { '$', ',', ' ' };
                CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
                TextInfo textInfo = cultureInfo.TextInfo;
                TextBox txtaddress = (TextBox)uccity.FindControl("txtaddress");
                string showname, showfedid, showcorpname, showcorpstreet = "", royalties, zipcodecorp;
                Nullable<Int32> cityid = null,companymgr_id=null;
                cityid = uccity.InsertCitydetails();
                Nullable<Decimal> overheadnut = null, wklyopexp = null;
                DateTime showbegindate;
                showname = textInfo.ToTitleCase(txtshowname.Text.Trim());
                showfedid = Convert.ToString(txtfederalid.Text.Trim());
                showcorpname = textInfo.ToTitleCase(txtname.Text.Trim());
                wklyopexp = (txtwklyopexp.Text.Trim() == "") ? wklyopexp : Convert.ToDecimal(txtwklyopexp.Text.Trim(chDlr));
                overheadnut = (txtoverheadnut.Text.Trim() == "") ? overheadnut : Convert.ToDecimal(txtoverheadnut.Text.Trim(chDlr));
                royalties = Convert.ToString(txtvariableroyalities.Text.Trim());
                showbegindate = Convert.ToDateTime(txtshowbegindate.Text);
                showcorpstreet = textInfo.ToTitleCase(txtaddress.Text.Trim());
                //zipcodecorp = (uccity.FindControl("txtzipcode") as TextBox).Text;
                zipcodecorp = uccity.Get_child_zipcode();
                companymgr_id = (ddlcompanymgr.SelectedIndex > 0) ? Convert.ToInt32(ddlcompanymgr.SelectedItem.Value) : companymgr_id;
                objShowData = new ShowData();
                if (string.IsNullOrEmpty(Request.QueryString["showid"]))
                {
                    if (hdnshowid.Value != "0")
                    {
                        lblerrmsg.Text = "Show name already exists!";
                    }
                    else
                    {
                        Int32 newshowid;
                        newshowid = objShowData.Showdata_Insert(showname, showfedid, showcorpname, showcorpstreet, overheadnut, cityid, wklyopexp, royalties, showbegindate, zipcodecorp, companymgr_id);
                        if (newshowid == 0)
                        {
                            lblerrmsg.Text = "Show name already exist!";
                        }
                        else
                        {

                            SavePrefShowDetails(newshowid);
                            ucdocx.SaveDocx(newshowid, "SHOW");
                            InsertPrefShowFooter(newshowid);
                            Response.Redirect("~/show.aspx?showid=" + newshowid.ToString() + "&type=I");
                        }
                    }
                }
                else if (!string.IsNullOrEmpty(Request.QueryString["showid"]))
                {
                    hdnshowid.Value = Request.QueryString["showid"].ToString();
                    int existid = 0;
                    existid = objShowData.Showdata_Update(hdnshowid.Value.ToString(), showname, showfedid, showcorpname, showcorpstreet, overheadnut, cityid, wklyopexp, royalties, showbegindate, zipcodecorp, companymgr_id);
                    SavePrefShowDetails(Convert.ToInt32(hdnshowid.Value));
                    LoadPrefShow_Details();
                    if (existid == 0)
                    {
                        Int32 sid = Convert.ToInt32(hdnshowid.Value);
                        divmsg.InnerHtml = "Record updated successfully!";
                        ucdocx.SaveDocx(sid, "SHOW");
                    }
                    else { lblerrmsg.Text = "Show name already exist!"; }
                }
            }
        }
Example #5
0
 public void LoadPrefShow_Details()
 {
     if (hdnshowid.Value != "0")
     {
         dt = new DataTable();
         objShowData = new ShowData();
         dt = objShowData.Get_Prefshowdetails(hdnshowid.Value);
         repbind.DataSource = dt;
         repbind.DataBind();
         ScriptManager.RegisterStartupScript(this, this.GetType(), "", "CheckAll();", true);
     }
     ClearPrefShow();
 }