Пример #1
0
        /// <summary>
        /// Hàm thực hiện khởi tạo thôngtin của khoa phòng
        /// </summary>
        /// <returns></returns>
        private Int16 CreateDepartment()
        {
            try
            {
                short Parent_ID = 0;

                var department = new DmucKhoaphong();
                department.MaKhoaphong    = txtDepartment_Code.Text;
                department.SttHthi        = Utility.Int16Dbnull(txtintOrder.Value, 0);
                department.TenKhoaphong   = txtDepartment_Name.Text;
                department.DonGia         = Utility.DecimaltoDbnull(txtDeptFee.Text, 0);
                department.MotaThem       = Utility.sDbnull(txtDesc.Text, "");
                department.NoitruNgoaitru = optNgoaitru.Checked ? "NGOAI" : (optNoitru.Checked ? "NOI" : "CAHAI");
                department.MaCha          =
                    (short?)(chkParent.Checked ? Utility.Int16Dbnull(cboParent_ID.SelectedValue, -1) : 0);
                department.TamUng      = Utility.DecimaltoDbnull(txtTIEN_TAM_UNG.Text, 0);
                department.MaDonvitinh = txtDonvitinh.myCode;
                department.NgayTao     = globalVariables.SysDate;
                department.NguoiTao    = globalVariables.UserName;
                department.MaPhongStt  = Utility.sDbnull(txtMaphongXepStt.Text);
                department.ChiDan      = Utility.sDbnull(txtPhong_Thien.Text);

                department.KieuKhoaphong = optPhong.Checked ? "PHONG" : "KHOA";

                department.PhongChucnang = (byte)(optChucnang.Checked ? 1 : 0);

                department.LaKhoacapcuu = (byte)(chkKhoaCapCuu.Checked ? 1 : 0);
                department.IsNew        = true;
                department.Save();
                return(department.IdKhoaphong);
            }
            catch
            {
                return(-1);
            }
        }
Пример #2
0
        public void Insert(string MaKhoaphong,string TenKhoaphong,short? MaCha,short SttHthi,string MotaThem,decimal? DonGia,decimal? TamUng,string NoitruNgoaitru,byte? LaKhoacapcuu,string KieuKhoaphong,byte? PhongChucnang,string MaDonvitinh,string NguoiTao,DateTime? NgayTao,string NguoiSua,DateTime? NgaySua,string ChiDan,string MaPhongStt)
        {
            DmucKhoaphong item = new DmucKhoaphong();

            item.MaKhoaphong = MaKhoaphong;

            item.TenKhoaphong = TenKhoaphong;

            item.MaCha = MaCha;

            item.SttHthi = SttHthi;

            item.MotaThem = MotaThem;

            item.DonGia = DonGia;

            item.TamUng = TamUng;

            item.NoitruNgoaitru = NoitruNgoaitru;

            item.LaKhoacapcuu = LaKhoacapcuu;

            item.KieuKhoaphong = KieuKhoaphong;

            item.PhongChucnang = PhongChucnang;

            item.MaDonvitinh = MaDonvitinh;

            item.NguoiTao = NguoiTao;

            item.NgayTao = NgayTao;

            item.NguoiSua = NguoiSua;

            item.NgaySua = NgaySua;

            item.ChiDan = ChiDan;

            item.MaPhongStt = MaPhongStt;

            item.Save(UserName);
        }
Пример #3
0
        /// <summary>
        /// Hàm thực hiện khởi tạo thôngtin của khoa phòng
        /// </summary>
        /// <returns></returns>
        private Int16 CreateDepartment()
        {
            try
            {
                short Parent_ID = 0;

                DmucKhoaphong department = new DmucKhoaphong();
                department.MaKhoaphong = txtDepartment_Code.Text;
                department.SttHthi = Utility.Int16Dbnull(txtintOrder.Value, 0);
                department.TenKhoaphong = txtDepartment_Name.Text;
                department.DonGia = Utility.DecimaltoDbnull(txtDeptFee.Text, 0);
                department.MotaThem = Utility.sDbnull(txtDesc.Text, "");
                department.NoitruNgoaitru = optNgoaitru.Checked ? "NGOAI" : (optNoitru.Checked ? "NOI" : "CAHAI");
                department.MaCha = (short?)(chkParent.Checked ? Utility.Int16Dbnull(cboParent_ID.SelectedValue, -1) : 0);
                department.TamUng = Utility.DecimaltoDbnull(txtTIEN_TAM_UNG.Text, 0);
                department.MaDonvitinh = txtDonvitinh.myCode;
                department.NgayTao = globalVariables.SysDate;
                department.NguoiTao = globalVariables.UserName;
                department.MaPhongStt = Utility.sDbnull(txtMaphongXepStt.Text);
                department.ChiDan = Utility.sDbnull(txtPhong_Thien.Text);

                department.KieuKhoaphong = optPhong.Checked ? "PHONG" : "KHOA";

                department.PhongChucnang = (byte)(optChucnang.Checked ? 1 : 0);

                department.LaKhoacapcuu = (byte)(chkKhoaCapCuu.Checked ? 1 : 0);
                department.IsNew = true;
                department.Save();
                return department.IdKhoaphong;
            }
            catch
            {
                return -1;
            }
        }