Exemplo n.º 1
0
        protected void imbSubmit_Click(object sender, ImageClickEventArgs e)
        {
            LicenseBiz      lService = new LicenseBiz();
            lwg_LicenseForm license  = new lwg_LicenseForm();

            license.Name        = this.txtName.Text;
            license.Email       = this.txtEmail.Text;
            license.Phone       = this.txtPhone.Text;
            license.Address     = this.txtAddress.Text;
            license.City        = this.txtCity.Text;
            license.State       = this.jumpMenu.Value;
            license.Zipcode     = this.txtZipcode.Text;
            license.LicenseType = (int)this.Type;

            if (lService.InsertLicense(license) == true)
            {
                this.ltrMessage.Text = "Your license is submitted successfully.";
            }
            else
            {
                this.ltrMessage.Text = "Your license is not submitted successfully. Please try again.";
            }
            this.pnForm.Visible    = false;
            this.pnMessage.Visible = true;
        }
        protected void grvLicense_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                lwg_LicenseForm license = (lwg_LicenseForm)e.Row.DataItem;
                Literal         ltrType = (Literal)e.Row.FindControl("ltrType");

                if (license != null && ltrType != null)
                {
                    ltrType.Text = LicenseBiz.GetLicenseType(license.LicenseType);
                }
            }
        }
Exemplo n.º 3
0
 public bool DeleteLiscense(int id)
 {
     if (id > 0)
     {
         lwg_LicenseForm lwg = context.lwg_LicenseForm.SingleOrDefault(lg => lg.IsDelete == false && lg.LicenseID == id);
         if (lwg != null)
         {
             lwg.IsDelete = true;
             context.SaveChanges();
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 4
0
        public bool InsertLicense(lwg_LicenseForm license)
        {
            if (license == null)
            {
                return(false);
            }

            try
            {
                license.CreatedDate = DateTime.Now;
                context.lwg_LicenseForm.Add(license);
                context.SaveChanges();
                return(true);
            }
            catch
            {
                throw;
            }
        }