Esempio n. 1
0
 public virtual void Remove(CONG_NO_WEB CONG_NO_WEB)
 {
     try
     {
         db.CONG_NO_WEBs.DeleteOnSubmit(CONG_NO_WEB);
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Esempio n. 2
0
 public virtual int Delete(int id)
 {
     try
     {
         CONG_NO_WEB CONG_NO_WEB = this.GetById(id);
         return(this.Delete(CONG_NO_WEB));
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
 public virtual void Create(CONG_NO_WEB CONG_NO_WEB)
 {
     try
     {
         this.db.CONG_NO_WEBs.InsertOnSubmit(CONG_NO_WEB);
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Esempio n. 4
0
 public virtual void Remove(int id)
 {
     try
     {
         CONG_NO_WEB CONG_NO_WEB = this.GetById(id);
         this.Remove(CONG_NO_WEB);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Esempio n. 5
0
 public virtual void Create(CONG_NO_WEB CONG_NO_WEB)
 {
     try
     {
         this.db.CONG_NO_WEBs.InsertOnSubmit(CONG_NO_WEB);
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
 public virtual void Remove(CONG_NO_WEB CONG_NO_WEB)
 {
     try
     {
         db.CONG_NO_WEBs.DeleteOnSubmit(CONG_NO_WEB);
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Esempio n. 7
0
 public virtual void Update(CONG_NO_WEB CONG_NO_WEB)
 {
     try
     {
         CONG_NO_WEB CONG_NO_WEBOld = this.GetById(CONG_NO_WEB.ID);
         CONG_NO_WEBOld = CONG_NO_WEB;
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Esempio n. 8
0
 public virtual int Delete(CONG_NO_WEB CONG_NO_WEB)
 {
     try
     {
         //CONG_NO_WEB.IsDelete = true;
         db.SubmitChanges();
         return(0);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
 public virtual void Update(CONG_NO_WEB CONG_NO_WEB)
 {
     try
     {
         CONG_NO_WEB CONG_NO_WEBOld = this.GetById(CONG_NO_WEB.ID);
         CONG_NO_WEBOld = CONG_NO_WEB;
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
        private int Save_Data()
        {
            if (id != 0)
            {
                var item = _CongNoWebRepo.GetById(id);
                item.SO_HOPDONG = txtSohopdong.Text;
                item.NGAYKY_HOPDONG = DateTime.ParseExact(txtNgaykyhopdong.Value, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                item.TEN_KHACHHANG = txtTenkhachhang.Text;
                item.THONGTINLIENHE_KHACHHANG = txtThongtinlienhe.Text;
                item.NOIDUNG = txtNoidung.Text;
                item.TEN_DOMAIN = txtTendomain.Text;
                item.NVKD = Utils.CIntDef(ddlNVKD.SelectedValue);
                item.NVXL = Utils.CIntDef(ddlNVXL.SelectedValue);
                item.DOMAIN_PRICE = Utils.CDecDef(txtDomain.Text.Replace(",", ""));
                item.CHIPHI_TRIENKHAI_PRICE = Utils.CDecDef(txtChiphitrienkhai.Text.Replace(",", ""));
                item.HOSTING_PRICE = Utils.CDecDef(txtHosting.Text.Replace(",", ""));
                item.WEB_PRICE = Utils.CDecDef(txtWeb.Text.Replace(",", ""));
                item.LOGO_PRICE = Utils.CDecDef(txtLogo.Text.Replace(",", ""));
                item.ESELL_PRICE = Utils.CDecDef(txtEsell.Text.Replace(",", ""));
                item.CHUPHINH_PRICE = Utils.CDecDef(txtChuphinh.Text.Replace(",", ""));
                item.CATALOGUE_PRICE = Utils.CDecDef(txtCatalogue.Text.Replace(",", ""));
                item.SEOTUKHOA_PRICE = Utils.CDecDef(txtSeotukhoa.Text.Replace(",", ""));
                item.GOOGLEADWORD_PRICE = Utils.CDecDef(txtGoogleadword.Text.Replace(",", ""));
                item.PHANMEM_PRICE = Utils.CDecDef(txtPhanmem.Text.Replace(",", ""));
                item.HOAHONGKH_PRICE = Utils.CDecDef(txtHoahongkh.Text.Replace(",", ""));
                item.VAT = Utils.CDecDef(txtVAT.Text.Replace(",", ""));
                item.TONGCONG = Utils.CDecDef(txtTongcong.Text.Replace(",", ""));
                item.THANHTOAN = Utils.CDecDef(txtThanhtoan.Text.Replace(",", ""));
                item.NGAYTHANHTOAN = txtNgaythanhtoan.Text;
                item.NGAYXUATHOADON = txtNgayxuathoadon.Text;
                item.CONGNO = Utils.CDecDef(txtCongno.Text.Replace(",", ""));
                item.GHICHU = txtGhichu.Text;
                item.TINHTRANG = Utils.CIntDef(ddlTinhtrang.SelectedValue);

                _CongNoWebRepo.Update(item);
            }
            else
            {
                CONG_NO_WEB item = new CONG_NO_WEB();
                item.SO_HOPDONG = txtSohopdong.Text;
                item.NGAYKY_HOPDONG = DateTime.ParseExact(txtNgaykyhopdong.Value, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                item.TEN_KHACHHANG = txtTenkhachhang.Text;
                item.THONGTINLIENHE_KHACHHANG = txtThongtinlienhe.Text;
                item.NOIDUNG = txtNoidung.Text;
                item.TEN_DOMAIN = txtTendomain.Text;
                item.NVKD = Utils.CIntDef(ddlNVKD.SelectedValue);
                item.NVXL = Utils.CIntDef(ddlNVXL.SelectedValue);
                item.DOMAIN_PRICE = Utils.CDecDef(txtDomain.Text.Replace(",", ""));
                item.CHIPHI_TRIENKHAI_PRICE = Utils.CDecDef(txtChiphitrienkhai.Text.Replace(",", ""));
                item.HOSTING_PRICE = Utils.CDecDef(txtHosting.Text.Replace(",", ""));
                item.WEB_PRICE = Utils.CDecDef(txtWeb.Text.Replace(",", ""));
                item.LOGO_PRICE = Utils.CDecDef(txtLogo.Text.Replace(",", ""));
                item.ESELL_PRICE = Utils.CDecDef(txtEsell.Text.Replace(",", ""));
                item.CHUPHINH_PRICE = Utils.CDecDef(txtChuphinh.Text.Replace(",", ""));
                item.CATALOGUE_PRICE = Utils.CDecDef(txtCatalogue.Text.Replace(",", ""));
                item.SEOTUKHOA_PRICE = Utils.CDecDef(txtSeotukhoa.Text.Replace(",", ""));
                item.GOOGLEADWORD_PRICE = Utils.CDecDef(txtGoogleadword.Text.Replace(",", ""));
                item.PHANMEM_PRICE = Utils.CDecDef(txtPhanmem.Text.Replace(",", ""));
                item.HOAHONGKH_PRICE = Utils.CDecDef(txtHoahongkh.Text.Replace(",", ""));
                item.VAT = Utils.CDecDef(txtVAT.Text.Replace(",", ""));
                item.TONGCONG = Utils.CDecDef(txtTongcong.Text.Replace(",", ""));
                item.THANHTOAN = Utils.CDecDef(txtThanhtoan.Text.Replace(",", ""));
                item.NGAYTHANHTOAN = txtNgaythanhtoan.Text;
                item.NGAYXUATHOADON = txtNgayxuathoadon.Text;
                item.CONGNO = Utils.CDecDef(txtCongno.Text.Replace(",", ""));
                item.GHICHU = txtGhichu.Text;
                item.TINHTRANG = Utils.CIntDef(ddlTinhtrang.SelectedValue);

                _CongNoWebRepo.Create(item);
                id = item.ID;
                return 1;
            }
            return 0;
        }
 public virtual int Delete(CONG_NO_WEB CONG_NO_WEB)
 {
     try
     {
         //CONG_NO_WEB.IsDelete = true;
         db.SubmitChanges();
         return 0;
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Esempio n. 12
0
        private int Save_Data()
        {
            if (id != 0)
            {
                var item = _CongNoWebRepo.GetById(id);
                item.SO_HOPDONG               = txtSohopdong.Text;
                item.NGAYKY_HOPDONG           = DateTime.ParseExact(txtNgaykyhopdong.Value, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                item.TEN_KHACHHANG            = txtTenkhachhang.Text;
                item.THONGTINLIENHE_KHACHHANG = txtThongtinlienhe.Text;
                item.NOIDUNG                = txtNoidung.Text;
                item.TEN_DOMAIN             = txtTendomain.Text;
                item.NVKD                   = Utils.CIntDef(ddlNVKD.SelectedValue);
                item.NVXL                   = Utils.CIntDef(ddlNVXL.SelectedValue);
                item.DOMAIN_PRICE           = Utils.CDecDef(txtDomain.Text.Replace(",", ""));
                item.CHIPHI_TRIENKHAI_PRICE = Utils.CDecDef(txtChiphitrienkhai.Text.Replace(",", ""));
                item.HOSTING_PRICE          = Utils.CDecDef(txtHosting.Text.Replace(",", ""));
                item.WEB_PRICE              = Utils.CDecDef(txtWeb.Text.Replace(",", ""));
                item.LOGO_PRICE             = Utils.CDecDef(txtLogo.Text.Replace(",", ""));
                item.ESELL_PRICE            = Utils.CDecDef(txtEsell.Text.Replace(",", ""));
                item.CHUPHINH_PRICE         = Utils.CDecDef(txtChuphinh.Text.Replace(",", ""));
                item.CATALOGUE_PRICE        = Utils.CDecDef(txtCatalogue.Text.Replace(",", ""));
                item.SEOTUKHOA_PRICE        = Utils.CDecDef(txtSeotukhoa.Text.Replace(",", ""));
                item.GOOGLEADWORD_PRICE     = Utils.CDecDef(txtGoogleadword.Text.Replace(",", ""));
                item.PHANMEM_PRICE          = Utils.CDecDef(txtPhanmem.Text.Replace(",", ""));
                item.HOAHONGKH_PRICE        = Utils.CDecDef(txtHoahongkh.Text.Replace(",", ""));
                item.VAT            = Utils.CDecDef(txtVAT.Text.Replace(",", ""));
                item.TONGCONG       = Utils.CDecDef(txtTongcong.Text.Replace(",", ""));
                item.THANHTOAN      = Utils.CDecDef(txtThanhtoan.Text.Replace(",", ""));
                item.NGAYTHANHTOAN  = txtNgaythanhtoan.Text;
                item.NGAYXUATHOADON = txtNgayxuathoadon.Text;
                item.CONGNO         = Utils.CDecDef(txtCongno.Text.Replace(",", ""));
                item.GHICHU         = txtGhichu.Text;
                item.TINHTRANG      = Utils.CIntDef(ddlTinhtrang.SelectedValue);

                _CongNoWebRepo.Update(item);
            }
            else
            {
                CONG_NO_WEB item = new CONG_NO_WEB();
                item.SO_HOPDONG               = txtSohopdong.Text;
                item.NGAYKY_HOPDONG           = DateTime.ParseExact(txtNgaykyhopdong.Value, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
                item.TEN_KHACHHANG            = txtTenkhachhang.Text;
                item.THONGTINLIENHE_KHACHHANG = txtThongtinlienhe.Text;
                item.NOIDUNG                = txtNoidung.Text;
                item.TEN_DOMAIN             = txtTendomain.Text;
                item.NVKD                   = Utils.CIntDef(ddlNVKD.SelectedValue);
                item.NVXL                   = Utils.CIntDef(ddlNVXL.SelectedValue);
                item.DOMAIN_PRICE           = Utils.CDecDef(txtDomain.Text.Replace(",", ""));
                item.CHIPHI_TRIENKHAI_PRICE = Utils.CDecDef(txtChiphitrienkhai.Text.Replace(",", ""));
                item.HOSTING_PRICE          = Utils.CDecDef(txtHosting.Text.Replace(",", ""));
                item.WEB_PRICE              = Utils.CDecDef(txtWeb.Text.Replace(",", ""));
                item.LOGO_PRICE             = Utils.CDecDef(txtLogo.Text.Replace(",", ""));
                item.ESELL_PRICE            = Utils.CDecDef(txtEsell.Text.Replace(",", ""));
                item.CHUPHINH_PRICE         = Utils.CDecDef(txtChuphinh.Text.Replace(",", ""));
                item.CATALOGUE_PRICE        = Utils.CDecDef(txtCatalogue.Text.Replace(",", ""));
                item.SEOTUKHOA_PRICE        = Utils.CDecDef(txtSeotukhoa.Text.Replace(",", ""));
                item.GOOGLEADWORD_PRICE     = Utils.CDecDef(txtGoogleadword.Text.Replace(",", ""));
                item.PHANMEM_PRICE          = Utils.CDecDef(txtPhanmem.Text.Replace(",", ""));
                item.HOAHONGKH_PRICE        = Utils.CDecDef(txtHoahongkh.Text.Replace(",", ""));
                item.VAT            = Utils.CDecDef(txtVAT.Text.Replace(",", ""));
                item.TONGCONG       = Utils.CDecDef(txtTongcong.Text.Replace(",", ""));
                item.THANHTOAN      = Utils.CDecDef(txtThanhtoan.Text.Replace(",", ""));
                item.NGAYTHANHTOAN  = txtNgaythanhtoan.Text;
                item.NGAYXUATHOADON = txtNgayxuathoadon.Text;
                item.CONGNO         = Utils.CDecDef(txtCongno.Text.Replace(",", ""));
                item.GHICHU         = txtGhichu.Text;
                item.TINHTRANG      = Utils.CIntDef(ddlTinhtrang.SelectedValue);

                _CongNoWebRepo.Create(item);
                id = item.ID;
                return(1);
            }
            return(0);
        }
        private void Import_data()
        {
            try
            {
                if (fileUpload.HasFile == true)
                {
                    string path = Server.MapPath("/File/ExcelFile/" + fileUpload.FileName);
                    fileUpload.SaveAs(path);
                    DataTable dt = getDataexcel(path);
                    int i = 0;
                    foreach (DataRow row in dt.Rows)
                    {
                        if (i > 0)
                        {
                            CONG_NO_WEB item = new CONG_NO_WEB();
                            item.SO_HOPDONG = Utils.CStrDef(row[0]).Trim();
                            item.NGAYKY_HOPDONG = DateTime.Parse(Utils.CStrDef(row[1]));
                            item.TEN_KHACHHANG = Utils.CStrDef(row[2]);
                            item.THONGTINLIENHE_KHACHHANG = Utils.CStrDef(row[3]);
                            item.NOIDUNG = Utils.CStrDef(row[4]);
                            item.TEN_DOMAIN = Utils.CStrDef(row[5]);
                            item.NVKD = null;
                            item.NVXL = null;
                            item.DOMAIN_PRICE = Utils.CDecDef(Utils.CStrDef(row[7]).Replace(",", ""));
                            item.CHIPHI_TRIENKHAI_PRICE = Utils.CDecDef(Utils.CStrDef(row[8]).Replace(",", ""));
                            item.HOSTING_PRICE = Utils.CDecDef(Utils.CStrDef(row[9]).Replace(",", ""));
                            item.WEB_PRICE = Utils.CDecDef(Utils.CStrDef(row[10]).Replace(",", ""));
                            item.LOGO_PRICE = Utils.CDecDef(Utils.CStrDef(row[11]).Replace(",", ""));
                            item.ESELL_PRICE = Utils.CDecDef(Utils.CStrDef(row[12]).Replace(",", ""));
                            item.CHUPHINH_PRICE = Utils.CDecDef(Utils.CStrDef(row[13]).Replace(",", ""));
                            item.CATALOGUE_PRICE = Utils.CDecDef(Utils.CStrDef(row[14]).Replace(",", ""));
                            item.SEOTUKHOA_PRICE = Utils.CDecDef(Utils.CStrDef(row[15]).Replace(",", ""));
                            item.GOOGLEADWORD_PRICE = Utils.CDecDef(Utils.CStrDef(row[16]).Replace(",", ""));
                            item.PHANMEM_PRICE = Utils.CDecDef(Utils.CStrDef(row[17]).Replace(",", ""));
                            item.HOAHONGKH_PRICE = Utils.CDecDef(Utils.CStrDef(row[18]).Replace(",", ""));
                            item.VAT = Utils.CDecDef(Utils.CStrDef(row[19]).Replace(",", ""));
                            item.TONGCONG = Utils.CDecDef(Utils.CStrDef(row[20]).Replace(",", ""));
                            item.THANHTOAN = Utils.CDecDef(Utils.CStrDef(row[21]).Replace(",", ""));
                            item.NGAYTHANHTOAN = Utils.CStrDef(row[22]);
                            item.NGAYXUATHOADON = Utils.CStrDef(row[23]);
                            item.CONGNO = Utils.CDecDef(Utils.CStrDef(row[24]).Replace(",", ""));
                            item.GHICHU = Utils.CStrDef(row[25]);
                            item.TINHTRANG = Utils.CIntDef(1);

                            _CongNoWebRepo.Create(item);
                        }
                        i++;
                    }
                    string strScript = "<script>";
                    strScript += "alert('Đã Import dữ liệu thành công');";
                    strScript += "window.location='danh-sach-cong-no-web.aspx';";
                    strScript += "</script>";
                    Page.RegisterClientScriptBlock("strScript", strScript);
                }
                else
                {
                    string strScript = "<script>";
                    strScript += "alert('Xin chọn file để Import');";
                    strScript += "window.location='danh-sach-cong-no-web.aspx';";
                    strScript += "</script>";
                    Page.RegisterClientScriptBlock("strScript", strScript);
                }
            }
            catch (Exception ex) { throw; }
        }
Esempio n. 14
0
        private void Import_data()
        {
            try
            {
                if (fileUpload.HasFile == true)
                {
                    string path = Server.MapPath("/File/ExcelFile/" + fileUpload.FileName);
                    fileUpload.SaveAs(path);
                    DataTable dt = getDataexcel(path);
                    int       i  = 0;
                    foreach (DataRow row in dt.Rows)
                    {
                        if (i > 0)
                        {
                            CONG_NO_WEB item = new CONG_NO_WEB();
                            item.SO_HOPDONG               = Utils.CStrDef(row[0]).Trim();
                            item.NGAYKY_HOPDONG           = DateTime.Parse(Utils.CStrDef(row[1]));
                            item.TEN_KHACHHANG            = Utils.CStrDef(row[2]);
                            item.THONGTINLIENHE_KHACHHANG = Utils.CStrDef(row[3]);
                            item.NOIDUNG                = Utils.CStrDef(row[4]);
                            item.TEN_DOMAIN             = Utils.CStrDef(row[5]);
                            item.NVKD                   = null;
                            item.NVXL                   = null;
                            item.DOMAIN_PRICE           = Utils.CDecDef(Utils.CStrDef(row[7]).Replace(",", ""));
                            item.CHIPHI_TRIENKHAI_PRICE = Utils.CDecDef(Utils.CStrDef(row[8]).Replace(",", ""));
                            item.HOSTING_PRICE          = Utils.CDecDef(Utils.CStrDef(row[9]).Replace(",", ""));
                            item.WEB_PRICE              = Utils.CDecDef(Utils.CStrDef(row[10]).Replace(",", ""));
                            item.LOGO_PRICE             = Utils.CDecDef(Utils.CStrDef(row[11]).Replace(",", ""));
                            item.ESELL_PRICE            = Utils.CDecDef(Utils.CStrDef(row[12]).Replace(",", ""));
                            item.CHUPHINH_PRICE         = Utils.CDecDef(Utils.CStrDef(row[13]).Replace(",", ""));
                            item.CATALOGUE_PRICE        = Utils.CDecDef(Utils.CStrDef(row[14]).Replace(",", ""));
                            item.SEOTUKHOA_PRICE        = Utils.CDecDef(Utils.CStrDef(row[15]).Replace(",", ""));
                            item.GOOGLEADWORD_PRICE     = Utils.CDecDef(Utils.CStrDef(row[16]).Replace(",", ""));
                            item.PHANMEM_PRICE          = Utils.CDecDef(Utils.CStrDef(row[17]).Replace(",", ""));
                            item.HOAHONGKH_PRICE        = Utils.CDecDef(Utils.CStrDef(row[18]).Replace(",", ""));
                            item.VAT            = Utils.CDecDef(Utils.CStrDef(row[19]).Replace(",", ""));
                            item.TONGCONG       = Utils.CDecDef(Utils.CStrDef(row[20]).Replace(",", ""));
                            item.THANHTOAN      = Utils.CDecDef(Utils.CStrDef(row[21]).Replace(",", ""));
                            item.NGAYTHANHTOAN  = Utils.CStrDef(row[22]);
                            item.NGAYXUATHOADON = Utils.CStrDef(row[23]);
                            item.CONGNO         = Utils.CDecDef(Utils.CStrDef(row[24]).Replace(",", ""));
                            item.GHICHU         = Utils.CStrDef(row[25]);
                            item.TINHTRANG      = Utils.CIntDef(1);

                            _CongNoWebRepo.Create(item);
                        }
                        i++;
                    }
                    string strScript = "<script>";
                    strScript += "alert('Đã Import dữ liệu thành công');";
                    strScript += "window.location='danh-sach-cong-no-web.aspx';";
                    strScript += "</script>";
                    Page.RegisterClientScriptBlock("strScript", strScript);
                }
                else
                {
                    string strScript = "<script>";
                    strScript += "alert('Xin chọn file để Import');";
                    strScript += "window.location='danh-sach-cong-no-web.aspx';";
                    strScript += "</script>";
                    Page.RegisterClientScriptBlock("strScript", strScript);
                }
            }
            catch (Exception ex) { throw; }
        }