Ejemplo n.º 1
0
        protected void gv_editcert_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int CertificateId = (int)gv_editcert.DataKeys[e.RowIndex].Values[0];

            CertificationBLL.deleteCertificate(CertificateId);
            Response.Redirect(HttpContext.Current.Request.Url.AbsoluteUri);
        }
Ejemplo n.º 2
0
        protected void btn_addcert_Click(object sender, EventArgs e)
        {
            string         cn          = txt_addcert.Text;
            string         cd          = txt_addcertdate.Text;
            MembershipUser CurrentUser = Membership.GetUser();
            Guid           UserId      = (Guid)CurrentUser.ProviderUserKey;

            CertificationBLL.InsertCertNameDate(cn, cd, UserId);

            lbl_data.Text = "Your Data is Saved";
        }
Ejemplo n.º 3
0
        private void InitCertificationList()
        {
            bll = new CertificationBLL();
            IList <Certification> _certifications = bll.GetAllCertifications();

            for (int i = 0; i < _certifications.Count; i++)
            {
                advTree1.Nodes.Add(CreateLicenseNode(_certifications[i].Id, _certifications[i].Serial, _certifications[i].CertType, _certifications[i].UnitName, _certifications[i].Type, _certifications[i].Madeby, _certifications[i].Date, _certifications[i].Expire, _certifications[i].VerifiedBy));
                //advTree_licenseList.Nodes.Add(CreateLicenseNode(dt.Rows[i]["证书编号"].ToString(), dt.Rows[i]["受检单位"].ToString(), Convert.ToDateTime(dt.Rows[i]["受检日期"].ToString()), int.Parse(dt.Rows[i]["ID"].ToString()), dt.Rows[i]["计量器具名称"].ToString(), dt.Rows[i]["检定员"].ToString(), dt.Rows[i]["型号"].ToString(), dt.Rows[i]["出厂编号"].ToString()));
            }
        }
Ejemplo n.º 4
0
        private void BindData()
        {
            advTree1.Nodes.Clear();
            bll = new CertificationBLL();
            IList <Certification> _certifications = bll.GetCertificationsBySearch(tb_keyword.Text, comb_range.Text, comb_type.Text, dt_start.Value, dt_end.Value, dt_expire1.Value, dt_expire2.Value);

            for (int i = 0; i < _certifications.Count; i++)
            {
                advTree1.Nodes.Add(CreateLicenseNode(_certifications[i].Id, _certifications[i].Serial, _certifications[i].CertType, _certifications[i].UnitName, _certifications[i].Type, _certifications[i].Madeby, _certifications[i].Date, _certifications[i].Expire, _certifications[i].VerifiedBy));
                //advTree_licenseList.Nodes.Add(CreateLicenseNode(dt.Rows[i]["证书编号"].ToString(), dt.Rows[i]["受检单位"].ToString(), Convert.ToDateTime(dt.Rows[i]["受检日期"].ToString()), int.Parse(dt.Rows[i]["ID"].ToString()), dt.Rows[i]["计量器具名称"].ToString(), dt.Rows[i]["检定员"].ToString(), dt.Rows[i]["型号"].ToString(), dt.Rows[i]["出厂编号"].ToString()));
            }
        }
Ejemplo n.º 5
0
        protected void gv_editcert_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            int CertificateId = (int)gv_editcert.DataKeys[e.RowIndex].Values[0];

            //In the Edit-Template ///\\\///\\\
            TextBox CertificateName = ((TextBox)gv_editcert.Rows[e.RowIndex].FindControl("txt_name"));
            TextBox CertificateDate = ((TextBox)gv_editcert.Rows[e.RowIndex].FindControl("txt_date"));

            CertificationBLL.Updatecert(CertificateId, CertificateName.Text, CertificateDate.Text);

            Response.Redirect(HttpContext.Current.Request.Url.AbsoluteUri);
        }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         MembershipUser CurrentUser = Membership.GetUser();
         if (CurrentUser == null)
         {
             Response.Redirect("~/Pages/User/Login.aspx");
         }
         else
         {
             Guid      FK_UserId = (Guid)CurrentUser.ProviderUserKey;
             DataTable dt        = CertificationBLL.GetByFK_UserId_(FK_UserId);
             gv_editcert.DataSource   = dt;
             gv_editcert.DataKeyNames = new string[] { "CertificateId" };
             gv_editcert.DataBind();
             ViewState["Certificate"] = dt;
         }
     }
 }
Ejemplo n.º 7
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            certBll              = new CertificationBLL();
            license              = new Certification();
            license.According    = tb_accordingTo.Text;
            license.ApprovedBy   = tb_approver.Text;
            license.Benchexpire1 = dt_benchExpire1.Value;
            license.BenchName1   = tb_benchname1.Text;
            license.BenchRange1  = tb_benchRange1.Text;
            license.BenchSerial1 = tb_benchserial1.Text;
            license.BenchSn1     = tb_benchSn1.Text;
            license.Notsure1     = tb_notsure1.Text;

            license.Benchexpire2 = dt_benchExpire2.Value;
            license.BenchName2   = tb_benchName2.Text;
            license.BenchRange2  = tb_benchRange2.Text;
            license.BenchSerial2 = tb_benchSerial2.Text;
            license.BenchSn2     = tb_benchSn2.Text;
            license.Notsure2     = tb_notSure2.Text;

            license.Benchexpire3    = dt_benchExpire3.Value;
            license.BenchName3      = tb_benchName3.Text;
            license.BenchRange3     = tb_benchRange3.Text;
            license.BenchSerial3    = tb_benchSerial3.Text;
            license.BenchSn3        = tb_benchSn3.Text;
            license.Notsure3        = tb_notSure3.Text;
            license.CheckedBy       = tb_check.Text;
            license.Comment         = tb_comment.Text;
            license.Date            = dt_date.Value;
            license.Expire          = dt_expire.Value;
            license.Humidity        = di_humidity.Text;
            license.InstructionName = tbd_instName.Text;
            license.LicenseNotsure  = tb_licenseNotsure.Text;
            license.Location        = comb_location.Text;
            license.Madeby          = tbd_madeBy.Text;
            license.Manufact_no     = tb_instSerial.Text;
            license.Module          = tb_module.Text;
            license.Presure         = di_presure.Text;
            license.Result          = tb_result.Text;
            license.ResultHTML      = GetResultAGrid();
            license.ResultHTML2     = (a_isOpen ? webBrowser1.Document.GetElementById("htmlText").InnerHtml : "");
            license.ResultHTML3     = (b_isOpen ? webBrowser2.Document.GetElementById("htmlText").InnerHtml : "");
            license.ResultHTML4     = (c_isOpen ? webBrowser3.Document.GetElementById("htmlText").InnerHtml : "");

            for (int i = 0; i < 3; i++)
            {
                if (string.IsNullOrEmpty(license.ResultHTML))
                {
                    license.ResultHTML  = license.ResultHTML2;
                    license.ResultHTML2 = license.ResultHTML3;
                    license.ResultHTML3 = license.ResultHTML4;
                }
            }
            for (int i = 0; i < 2; i++)
            {
                if (string.IsNullOrEmpty(license.ResultHTML2))
                {
                    license.ResultHTML2 = license.ResultHTML3;
                    license.ResultHTML3 = license.ResultHTML4;
                }
            }
            if (string.IsNullOrEmpty(license.ResultHTML3))
            {
                license.ResultHTML3 = license.ResultHTML4;
            }



            license.Serial      = tb_licenseNo.Text;
            license.Telephone   = tb_authToTel.Text;
            license.Temperature = di_temperatue.Text;
            license.Type        = tb_type.Text;
            license.UnitName    = tb_authTo.Text;
            license.UseLimit    = tb_limit.Text;
            license.VerifiedBy  = tb_recorder.Text;
            license.UseLicense  = tb_license.Text;
            license.PrintCount  = 0;
            if (radio_exam.Checked)
            {
                license.CertType = "检定";
            }
            else if (radio_match.Checked)
            {
                license.CertType = "校准";
            }
            else if (radio_test.Checked)
            {
                license.CertType = "测试";
            }
            if (certBll.AddCertification(license))
            {
                MessageBox.Show("添加成功");
            }
            else
            {
                MessageBox.Show("添加成功");
            }
        }