Пример #1
0
        protected void buttonedit_click(object sender, EventArgs e)
        {
            string value = hfdstateid.Value;

            Person_Details.tbl_otherstatelicense obj = Licensing_Details.Edit_otherstatelicense(Convert.ToInt32(value));
            hfdstateid.Value = obj.Osl_ID.ToString();
            Txt_licnum.Text  = obj.Licno;
            string status = "";

            status = obj.Status.ToString();
            if (ddlstatus.Items[0].Text != status)
            {
                ddlstatus.Items[0].Selected = false;
                if (ddlstatus.Items.FindByText(status) != null)
                {
                    ddlstatus.Items.FindByText(status).Selected = true;
                }
            }
            if (obj.Date_Received == Convert.ToDateTime("01/01/1900"))
            {
                Txt_datereceived.Text = "";
            }
            else
            {
                Txt_datereceived.Text = Convert.ToDateTime(obj.Date_Received).ToString("MM/dd/yyyy");
            }



            //string isparent = obj.Is_ParentLicmust;
            //if (isparent == "True")
            //    chk_parentidmust.Checked = true;
            //else
            //    chk_parentidmust.Checked = false;
            string Otherstatelicense = obj.isothers.ToString();

            if (Otherstatelicense == "True")
            {
                Chk_otherstatelic.Checked = true;
            }
            else
            {
                Chk_otherstatelic.Checked = false;
            }
            Txt_state.Text = obj.states;
            string js = "Popup2();";

            ScriptManager.RegisterStartupScript(Page, GetType(), "scr", js, true);
        }
Пример #2
0
        protected void btn_licsubmit_Click(object sender, EventArgs e)
        {
            {
                if (hfdstateid.Value == "0")
                {
                    //Utilities_Licensing.Insert_Employer(Convert.ToInt32(hfdpid.Value), 1, 2, txt_employeetype.Text.ToString(), txt_Name.Text.ToString(), txt_address.Text.ToString(), txt_city.Text.ToString(), ddlstate.SelectedItem.Text, txt_zip.Text.ToString(), ddlcounty.SelectedItem.Text, "1");
                    //Utilities_Licensing.BindGridEmployer(grdemployee);
                    Person_Details.tbl_otherstatelicense objotherstatelic = new Person_Details.tbl_otherstatelicense();
                    objotherstatelic.Osl_ID = 0;
                    objotherstatelic.Per_ID = Convert.ToInt32(hfdpid.Value);
                    objotherstatelic.Status = ddlstatus.SelectedItem.Text;
                    objotherstatelic.Licno  = Txt_licnum.Text.ToString();
                    if (Txt_datereceived.Text != "")
                    {
                        objotherstatelic.Date_Received = Convert.ToDateTime(Txt_datereceived.Text);
                    }
                    else
                    {
                        objotherstatelic.Date_Received = Convert.ToDateTime("01 / 01 / 1900");
                    }


                    objotherstatelic.states     = Txt_state.Text;
                    objotherstatelic.createdby  = Convert.ToString(Session["UID"]);
                    objotherstatelic.createddt  = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                    objotherstatelic.modifiedby = Convert.ToString(Session["UID"]);
                    objotherstatelic.modifieddt = Convert.ToDateTime(DateTime.Now.ToShortDateString());


                    bool Otherstatelicense;

                    if (Chk_otherstatelic.Checked == true)
                    {
                        Otherstatelicense = true;
                    }


                    else
                    {
                        Otherstatelicense = false;
                    }

                    objotherstatelic.isothers = Otherstatelicense;

                    Person_Details.Licensing_Details.insertotherstatelic(objotherstatelic);

                    //Utilities_Licensing.BindGridEmployer(grdemployee, Convert.ToInt32(hfdpid.Value));
                    Page.RegisterStartupScript("js", "<script>osl.process();</script>");
                    altbox("Record inserted successfully.");
                    licClear();
                }


                else
                {
                    Person_Details.tbl_otherstatelicense objotherstatelic = new Person_Details.tbl_otherstatelicense();

                    objotherstatelic.Osl_ID = Convert.ToInt32(hfdstateid.Value);
                    objotherstatelic.Per_ID = Convert.ToInt32(hfdpid.Value);
                    objotherstatelic.Status = ddlstatus.SelectedItem.Text;
                    objotherstatelic.Licno  = Txt_licnum.Text.ToString();
                    if (Txt_datereceived.Text != "")
                    {
                        objotherstatelic.Date_Received = Convert.ToDateTime(Txt_datereceived.Text);
                    }
                    else
                    {
                        objotherstatelic.Date_Received = Convert.ToDateTime("01 / 01 / 1900");
                    }

                    objotherstatelic.states     = Txt_state.Text;
                    objotherstatelic.createdby  = Convert.ToString(Session["UID"]);
                    objotherstatelic.createddt  = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                    objotherstatelic.modifiedby = Convert.ToString(Session["UID"]);
                    objotherstatelic.modifieddt = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                    bool Otherstatelicense;

                    if (Chk_otherstatelic.Checked == true)
                    {
                        Otherstatelicense = true;
                    }


                    else
                    {
                        Otherstatelicense = false;
                    }

                    objotherstatelic.isothers = Otherstatelicense;
                    Person_Details.Licensing_Details.updateotherstatelic(objotherstatelic);

                    //Utilities_Licensing.BindGridEmployer(grdemployee, Convert.ToInt32(hfdpid.Value));
                    Page.RegisterStartupScript("js", "<script>osl.process();</script>");
                    altbox("Record updated successfully.");
                    licClear();
                }
            }
        }