Example #1
0
        public FormatSettings(Format.ExportFormats format, MainWindow parent)
        {
            this.InitializeComponent();
            this.Owner = parent;

            //Дефолты
            this.format = format;
            this.def = Formats.GetDefaults(format);

            //Включаем\выключаем редактирование
            //Video
            textbox_vcodecs.IsEnabled = def.VCodecs_IsEditable;
            textbox_framerates.IsEnabled = def.Framerates_IsEditable;
            combo_MinResolutionW.IsEnabled = combo_MinResolutionH.IsEnabled =
                combo_MidResolutionW.IsEnabled = combo_MidResolutionH.IsEnabled =
                combo_MaxResolutionW.IsEnabled = combo_MaxResolutionH.IsEnabled =
                combo_ValidModW.IsEnabled = combo_ValidModH.IsEnabled = def.Resolution_IsEditable;
            textbox_aspects.IsEnabled = def.Aspects_IsEditable;
            combo_fix_ar_method.IsEnabled = (def.LockedAR_Methods.Length > 1);
            check_anamorphic.IsEnabled = def.Anamorphic_IsEditable;
            check_interlaced.IsEnabled = def.Interlaced_IsEditable;

            //Audio
            textbox_acodecs.IsEnabled = def.ACodecs_IsEditable;
            textbox_samplerates.IsEnabled = def.Samplerates_IsEditable;
            check_stereo.IsEnabled = def.LimitedToStereo_IsEditable;

            //Muxing
            combo_Muxer.IsEnabled = (def.Muxers.Length > 1);
            combo_Extension.IsEnabled = (def.Extensions.Length > 1);
            combo_split.IsEnabled = (def.Splitting != "None");
            check_dont_mux.IsEnabled = def.DontMuxStreams_IsEditable;
            check_direct_encoding.IsEnabled = def.DirectEncoding_IsEditable;
            check_direct_remux.IsEnabled = def.DirectRemuxing_IsEditable;
            check_4gb_only.IsEnabled = def.LimitedTo4Gb_IsEditable;

            //Переводим фокус
            int active_tab = 0;
            if (int.TryParse(Settings.GetFormatPreset(format, "ActiveTab"), out active_tab))
            {
                if (active_tab == 2) tab_audio.IsSelected = true;
                else if (active_tab == 3) tab_muxing.IsSelected = true;
            }

            LoadSettings();
            TranslateItems();
            SetTooltips();

            //Предупреждение (один раз для каждого формата)
            if (format != Format.ExportFormats.Custom && !Convert.ToBoolean(Settings.GetFormatPreset(format, "was_warned")))
            {
                Message mes = new Message(parent);
                mes.ShowMessage(Languages.Translate("Some options or their combinations may not work as you expect!") + "\r\n" +
                    Languages.Translate("After making any changes the format may become completely broken!"), Languages.Translate("Warning"), Message.MessageStyle.Ok);
                Settings.SetFormatPreset(format, "was_warned", bool.TrueString);
            }

            ShowDialog();
        }
Example #2
0
 public RunnerBase(Verbosity verbosity, Formats formats, TextWriter writer, CancellationToken cancellationToken, Progress<Indicator> progress, SemaphoreSlim semaphore)
 {
     this.verbosity = verbosity;
     this.formats = formats;
     this.cancellationToken = cancellationToken;
     this.writer = writer;
     this.progress = progress;
     this.handler = new EventHandler<Indicator>((_, v) => WriteProgress(v));
     this.semaphore = semaphore;
 }
Example #3
0
 internal Workbook(XlsDocument doc)
 {
     _doc = doc;
     _doc.Workbook = this;
     _worksheets = new Worksheets(_doc);
     _fonts = new Fonts(_doc);
     _formats = new Formats(_doc);
     _styles = new Styles(_doc);
     _xfs = new XFs(_doc, this);
     _palette = new Palette(this);
 }
Example #4
0
        private static void write_worksheet(DataSource datasource, Formats.ExcelXMLWriter writer, string sheetname, bool write_column_headers)
        {
            var schema = datasource.GetSchema();
            int num_cols = schema.Fields.Count;
            var datatypes = Enumerable.Repeat(Formats.ExcelXMLWriter.DataType.String, num_cols).ToArray();

            for (int i = 0; i < num_cols; i++)
            {
                var col = schema.Fields[i];
                if (col.Type == typeof(System.DateTime))
                {
                    datatypes[i] = Formats.ExcelXMLWriter.DataType.DateTime;
                }
            }

            writer.StartWorkSheet(sheetname, num_cols, datatypes);

            if (write_column_headers)
            {
                writer.StartRow();
                foreach (var col in schema.Fields)
                {
                    var cn = col.Name;
                    var cdt = Formats.ExcelXMLWriter.DataType.String;
                    writer.Cell(cn, cdt);
                }

                writer.EndRow();
            }

            var excel_datatypes = schema.Fields.AsEnumerable().Select(col => DataUtil.getdt(col.Type)).ToList();

            foreach (var row in datasource.Rows)
            {
                writer.StartRow();
                for (int i = 0; i < row.ItemArray.Length; i++)
                {
                    var datatable_col = schema.Fields[i];
                    var excel_dt = excel_datatypes[i];
                    var item = row.ItemArray[i];

                    string cell_str = Isotope.Data.DataUtil.DataTableToExcelXML_get_cellstr(item, excel_dt, datatable_col);

                    writer.Cell(cell_str, excel_dt);
                }

                writer.EndRow();
            }

            writer.EndWorkSheet();
        }
        public void Insert_Hang(int ID)
        {
            int tblHangHoa_Count = DBDataProvider.DB.hhHangHoas.Where(x => x.IDHangHoa == ID && x.DaXoa == 0 && x.LoaiHHID == 1).Count();

            if (tblHangHoa_Count > 0)
            {
                var tblHangHoa     = DBDataProvider.DB.hhHangHoas.Where(x => x.IDHangHoa == ID && x.DaXoa == 0).FirstOrDefault();
                var exitProdInList = listReceiptProducts.SingleOrDefault(r => r.IDHangHoa == ID);
                if (exitProdInList == null)
                {
                    oImportProduct_ChiTietKiemKe newKiemKe = new oImportProduct_ChiTietKiemKe(
                        tblHangHoa.IDHangHoa,
                        tblHangHoa.MaHang,
                        tblHangHoa.TenHangHoa,
                        Convert.ToInt32(tblHangHoa.hhTonKhos.Where(s => s.ChiNhanhID == Convert.ToInt32(Formats.IDChiNhanh())).FirstOrDefault().SoLuong),
                        0,
                        -Convert.ToInt32(tblHangHoa.hhTonKhos.Where(s => s.ChiNhanhID == Convert.ToInt32(Formats.IDChiNhanh())).FirstOrDefault().SoLuong),
                        0,
                        ""
                        );
                    listReceiptProducts.Add(newKiemKe);
                }
                else
                {
                    exitProdInList.TonKhoThucTe += 1;
                    exitProdInList.ChenhLech     = exitProdInList.TonKhoThucTe - exitProdInList.TonKhoHeThong;
                }
                UpdateSTT();
            }
            else
            {
                ccbBarcode.Value = "";
                ccbBarcode.Text  = "";
                ccbBarcode.Focus();
                throw new Exception("Mã hàng không tồn tại!!");
            }
        }
Example #6
0
        public override string ToString()
        {
            var filterParameters = new StringBuilder(100);

            if (Dimensions.HasValue && Dimensions.Value.Width > 0)
            {
                FilterUtility.ConcatenateParameter(filterParameters, "w", Dimensions.GetValueOrDefault().Width);
            }
            if (Dimensions.HasValue && Dimensions.Value.Height > 0)
            {
                FilterUtility.ConcatenateParameter(filterParameters, "h", Dimensions.GetValueOrDefault().Height);
            }
            if (Interlacing.HasValue && Interlacing != 0)
            {
                FilterUtility.ConcatenateParameter(filterParameters, "interl", Interlacing);
            }
            if (!string.IsNullOrWhiteSpace(Flags))
            {
                FilterUtility.ConcatenateParameter(filterParameters, "flags", Flags);
            }
            if (InColorMatrix != VideoScalingColorMatrixType.Auto)
            {
                FilterUtility.ConcatenateParameter(filterParameters, "in_color_matrix", Formats.EnumValue(InColorMatrix));
            }
            if (OutColorMatrix != VideoScalingColorMatrixType.Auto)
            {
                FilterUtility.ConcatenateParameter(filterParameters, "out_color_matrix", Formats.EnumValue(OutColorMatrix));
            }
            if (InRange != VideoScalingRangeType.Auto)
            {
                FilterUtility.ConcatenateParameter(filterParameters, "in_range", Formats.EnumValue(InRange, true));
            }
            if (OutRange != VideoScalingRangeType.Auto)
            {
                FilterUtility.ConcatenateParameter(filterParameters, "out_range", Formats.EnumValue(OutRange, true));
            }
            if (ForceAspectRatio != VideoScalingAspectRatioType.Disable)
            {
                FilterUtility.ConcatenateParameter(filterParameters, "force_original_aspect_ratio", Formats.EnumValue(ForceAspectRatio));
            }

            return(FilterUtility.JoinTypeAndParameters(this, filterParameters));
        }
Example #7
0
        public SeccsWriter(FormatOptions options = null)
        {
            this.Options = options ?? new FormatOptions();

            Formats.Discover();
        }
Example #8
0
 public StepRunner(Indicator indicator, Verbosity verbosity, Formats formats, TextWriter writer, CancellationToken cancellationToken, Progress<Indicator> progress, SemaphoreSlim semaphore)
     : base(verbosity, formats, writer, cancellationToken, progress, semaphore)
 {
     this.indicator = indicator;
     this.title = indicator.Name + GetIndent(indicator.Name);
 }
Example #9
0
 protected void dateEditControl_Init(object sender, EventArgs e)
 {
     Formats.InitDateEditControl(sender, e);
 }
 public NumbersPageViewModel()
 {
     _selectedFormat = Formats.FirstOrDefault();
 }
        private void PhieuDenHang(string ID)
        {
            int IDKhachHang = int.Parse(ID);
            int ThoiHanTT   = int.Parse(gridDanhSachKH.GetRowValuesByKeyValue(ID, "ThoiHanThanhToan").ToString());
            List <ghPhieuGiaoHang> listPhieuGH = DBDataProvider.DB.ghPhieuGiaoHangs.Where(x => x.KhachHangID == IDKhachHang && x.TTThanhToan == 0 && SqlMethods.DateDiffDay(x.NgayDuyet, DateTime.Now) > ThoiHanTT).ToList();
            string ThongBao = "<table>";

            foreach (var p in listPhieuGH)
            {
                ThongBao += "<tr>";
                ThongBao += string.Format("<td>Phiếu {0}&nbsp;&nbsp;</td><td>&nbsp;&nbsp;Ngày {1}</td>", p.STTDonHang, Formats.ConvertToVNDateString(p.NgayDuyet.ToString()));
                ThongBao += "</tr>";
            }
            ThongBao       += "</tbale>";
            litNoiDung.Text = ThongBao;
        }
Example #12
0
		public override String Show(int col, int row, Formats fo) { return "'" + value.value; }
Example #13
0
		// Show contents as expression
		public abstract String Show(int col, int row, int ctxpre, Formats fo);
Example #14
0
		// Show infixed operators as infix and without excess parentheses

		public override String Show(int col, int row, int ctxpre, Formats fo) {
			StringBuilder sb = new StringBuilder();
			int pre = function.fixity;
			if (pre == 0) { // Not operator
				sb.Append(function.name).Append("(");
				for (int i = 0; i < es.Length; i++) {
					if (i > 0) {
						sb.Append(", ");
					}
					sb.Append(es[i].Show(col, row, 0, fo));
				}
				sb.Append(")");
			}
			else { // Operator.  Assume es.Length is 1 or 2 
				if (es.Length == 2) {
					// If precedence lower than context, add parens
					if (pre < ctxpre) {
						sb.Append("(");
					}
					sb.Append(es[0].Show(col, row, pre, fo));
					sb.Append(function.name);
					// Only higher precedence right operands avoid parentheses
					sb.Append(es[1].Show(col, row, pre + 1, fo));
					if (pre < ctxpre) {
						sb.Append(")");
					}
				}
				else if (es.Length == 1) {
					sb.Append(function.name == "NEG" ? "-" : function.name);
					sb.Append(es[0].Show(col, row, pre, fo));
				}
				else {
					throw new ImpossibleException("Operator not unary or binary");
				}
			}
			return sb.ToString();
		}
Example #15
0
		public String Show(int col, int row, Formats fo) { return formula.Show(col, row, fo); }
        protected void Save()
        {
            using (var scope = new TransactionScope())
            {
                try
                {
                    if (listReceiptProducts.Count > 0)
                    {
                        int ChenhLech = 0;
                        foreach (var prod in listReceiptProducts)
                        {
                            ChenhLech += prod.ChenhLech;
                        }

                        string MaPhieu = null, strMaPhieu = "KK";
                        string MAX = (DBDataProvider.DB.kKiemKes.Count() + 1).ToString();
                        for (int i = 1; i < (7 - MAX.Length); i++)
                        {
                            strMaPhieu += "0";
                        }
                        MaPhieu = strMaPhieu + MAX;


                        //Insert vào bảng kiểm kê
                        kKiemKe kk = new kKiemKe();
                        kk.MaPhieu    = MaPhieu;
                        kk.IDNhanVien = Formats.IDUser();
                        kk.NgayLap    = Formats.ConvertToDateTime(dateNgayNhap.Text);
                        kk.GhiChu     = memoGhiChu.Text;
                        kk.DaXoa      = 0;
                        kk.NgayTao    = DateTime.Now;
                        kk.ChenhLech  = ChenhLech;
                        kk.ChiNhanhID = Formats.IDChiNhanh();
                        //kk.TrangThai = 0;
                        DBDataProvider.DB.kKiemKes.InsertOnSubmit(kk);
                        DBDataProvider.DB.SubmitChanges();

                        int IDPhieuKiemKe = kk.IDPhieuKiemKe;

                        foreach (var prod in listReceiptProducts)
                        {
                            //Insert vào chi tiết kiểm kê
                            kKiemKeChiTiet chitiet = new kKiemKeChiTiet();
                            chitiet.PhieuKiemKeID = IDPhieuKiemKe;
                            chitiet.HangHoaID     = prod.IDHangHoa;
                            chitiet.TonKhoHeThong = prod.TonKhoHeThong;
                            chitiet.TonKhoThucTe  = prod.TonKhoThucTe;
                            chitiet.ChenhLech     = prod.ChenhLech;
                            chitiet.DienGiai      = prod.DienGiai;
                            DBDataProvider.DB.kKiemKeChiTiets.InsertOnSubmit(chitiet);

                            //Ghi thẻ kho || Cập nhật tồn kho = thực tế
                            var TonKhoBanDau = DBDataProvider.DB.hhHangHoas.Where(x => x.IDHangHoa == prod.IDHangHoa).FirstOrDefault();
                            if (TonKhoBanDau != null)
                            {
                                TonKhoBanDau.hhTonKhos.Where(s => s.ChiNhanhID == Formats.IDChiNhanh()).FirstOrDefault().SoLuong = prod.TonKhoThucTe;
                                #region ghi thẻ kho
                                kTheKho thekho = new kTheKho();
                                thekho.NgayNhap = DateTime.Now;
                                thekho.DienGiai = "Kiểm kho #" + MaPhieu;
                                if (prod.ChenhLech > 0)
                                {
                                    thekho.Nhap = prod.ChenhLech;
                                    thekho.Xuat = 0;
                                }
                                else
                                {
                                    thekho.Nhap = 0;
                                    thekho.Xuat = (-1) * prod.ChenhLech;
                                }
                                thekho.Ton         = prod.TonKhoThucTe;
                                thekho.GiaThoiDiem = 0;
                                thekho.ChiNhanhID  = Formats.IDChiNhanh();
                                thekho.HangHoaID   = TonKhoBanDau.IDHangHoa;
                                thekho.NhanVienID  = Formats.IDUser();
                                DBDataProvider.DB.kTheKhos.InsertOnSubmit(thekho);
                                #endregion
                            }
                        }
                        DBDataProvider.DB.SubmitChanges();
                        scope.Complete();
                        Reset();
                        cbpInfo.JSProperties["cp_Reset"] = true;
                    }
                    else
                    {
                        throw new Exception("Danh sách kiểm kê trống !!");
                        ccbBarcode.Text  = "";
                        ccbBarcode.Value = "";
                        ccbBarcode.Focus();
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
        private void CreateReportReview_Save(int IDPhieu)
        {
            hdfViewReport["view"] = 1;
            var PhieuGiaoHang = DBDataProvider.GetPhieuGiaoHang(IDPhieu);

            oCusExport                   = new oReportGiaoHang();
            oCusExport.MaKhachHang       = PhieuGiaoHang.khKhachHang.MaKhachHang;
            oCusExport.TenKhachHang      = PhieuGiaoHang.khKhachHang.HoTen;
            oCusExport.DienThoai         = PhieuGiaoHang.DienThoai;
            oCusExport.DiaChiGiaoHang    = PhieuGiaoHang.DiaChiGiaoHang;
            oCusExport.TenNhanVien       = PhieuGiaoHang.nvNhanVien.HoTen;
            oCusExport.GhiChuGiaoHang    = PhieuGiaoHang.GhiChuGiaoHang;
            oCusExport.NgayGiao          = Formats.ConvertToVNDateString(PhieuGiaoHang.NgayGiao.ToString());
            oCusExport.NgayTao           = Formats.ConvertToVNDateString(PhieuGiaoHang.NgayTao.ToString());
            oCusExport.TongSoLuong       = Convert.ToInt32(PhieuGiaoHang.TongSoLuong);
            oCusExport.TongTien          = Convert.ToDouble(PhieuGiaoHang.TongTien);
            oCusExport.ThanhToan         = Convert.ToDouble(PhieuGiaoHang.ThanhToan);
            oCusExport.CongNoHienTai     = Convert.ToDouble(PhieuGiaoHang.CongNoHienTai);
            oCusExport.SoHoaDon          = PhieuGiaoHang.SoHoaDon;
            oCusExport.GiamGia           = Convert.ToDouble(PhieuGiaoHang.GiamGia);
            oCusExport.SoDonHangTrongNam = PhieuGiaoHang.SoDonHangTrongNam.ToString();
            oCusExport.TieuDePhieu       = "PHIẾU BÁN HÀNG " + PhieuGiaoHang.STTDonHang;
            string TrangThai = "";

            switch (PhieuGiaoHang.TrangThai)
            {
            case 0:
                TrangThai = "(Đã đặt)";
                break;

            case 1:
                TrangThai = "(Kiêm phiếu xuất kho)";
                break;

            case 3:
                TrangThai = "(Kiêm phiếu xuất kho)";
                break;

            default:
                TrangThai = "(Đã hủy)";
                break;
            }
            oCusExport.TrangThaiPhieu = TrangThai;
            oCusExport.listProduct    = new List <oProduct>();
            List <ghPhieuGiaoHangChiTiet> ListHang = DBDataProvider.ListChiTietGiaoHang(IDPhieu);
            int i = 1;

            foreach (var Hang in ListHang)
            {
                oProduct prod = new oProduct();
                prod.STT          = i++;
                prod.MaHang       = Hang.hhHangHoa.MaHang;
                prod.TenHang      = Hang.hhHangHoa.TenHangHoa;
                prod.TenDonViTinh = Hang.hhHangHoa.hhDonViTinh.TenDonViTinh;
                prod.SoLuong      = Convert.ToInt32(Hang.SoLuong);
                prod.DonGia       = Convert.ToDouble(Hang.GiaBan);
                prod.ThanhTien    = Convert.ToDouble(Hang.ThanhTien);
                oCusExport.listProduct.Add(prod);
            }
            cbpInfoImport.JSProperties["cp_rpView"] = true;
        }
Example #18
0
		public override String Show(int col, int row, int ctxpre, Formats fo) { return error; }
Example #19
0
 protected void gridDoanhThu_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     Formats.InitDisplayIndexColumn(e);
 }
Example #20
0
        public static Formats GetDefaults(Format.ExportFormats format)
        {
            //"Инициализируем"
            if (defaults_list == null)
            {
                lock (locker_def)
                {
                    defaults_list = new List<Formats>();
                    for (int i = 0; i < Enum.GetValues(typeof(Format.ExportFormats)).Length; i++)
                        defaults_list.Add(null);
                }
            }

            //Определяем дефолты для требуемого формата
            if (defaults_list[(int)format] == null)
            {
                lock (locker_def)
                {
                    defaults_list[(int)format] = new Formats(format);
                }
            }

            //Выдаём дефолты по индексу
            return defaults_list[(int)format];
        }
Example #21
0
        public void Insert_Hang(int ID)
        {
            int tblHangHoa_Count = DBDataProvider.DB.hhHangHoas.Where(x => x.IDHangHoa == ID && x.DaXoa == 0).Count();

            if (tblHangHoa_Count > 0)
            {
                int IDKhachHang           = Convert.ToInt32(ccbNhaCungCap.Value.ToString());
                var IDKhachHang_IDBangGia = DBDataProvider.DB.khKhachHangs.Where(x => x.IDKhachHang == IDKhachHang).FirstOrDefault();
                var tblHangHoa            = DBDataProvider.DB.hhHangHoas.Where(x => x.IDHangHoa == ID && x.DaXoa == 0).FirstOrDefault();
                var exitProdInList        = listReceiptProducts.SingleOrDefault(r => r.IDHangHoa == ID);
                if (exitProdInList == null)
                {
                    var    GiaBan_IDKhachHang = DBDataProvider.DB.bgChiTietBangGias.Where(x => x.BangGiaID == IDKhachHang_IDBangGia.IDBangGia && x.HangHoaID == tblHangHoa.IDHangHoa && x.bgBangGia.DaXoa == 0).FirstOrDefault();
                    double GiaBan             = GiaBan_IDKhachHang == null?Convert.ToDouble(tblHangHoa.GiaBan) :  Convert.ToDouble(GiaBan_IDKhachHang.GiaMoi);

                    oChiTietHoaDon cthd = new oChiTietHoaDon(
                        tblHangHoa.IDHangHoa,
                        tblHangHoa.MaHang,
                        tblHangHoa.TenHangHoa,
                        tblHangHoa.hhDonViTinh.TenDonViTinh,
                        Convert.ToInt32(tblHangHoa.hhTonKhos.Where(s => s.ChiNhanhID == Convert.ToInt32(Formats.IDChiNhanh())).FirstOrDefault().SoLuong),
                        1,
                        GiaBan,
                        Convert.ToDouble(tblHangHoa.GiaVon),
                        GiaBan, 0, GiaBan
                        );
                    listReceiptProducts.Add(cthd);
                }
                else
                {
                    exitProdInList.SoLuong  += 1;
                    exitProdInList.ThanhTien = exitProdInList.SoLuong * exitProdInList.GiaBan;
                }
                UpdateSTT();
            }
            else
            {
                ccbBarcode.Value = "";
                ccbBarcode.Text  = "";
                ccbBarcode.Focus();
                throw new Exception("Mã hàng không tồn tại !!");
            }
        }
Example #22
0
		public override String Show(int col, int row, Formats fo) { return ""; }
Example #23
0
		public override String Show(int col, int row, Formats fo) { return "{" + caf.Show(caf.formulaCol, caf.formulaRow, fo) + "}"; }
Example #24
0
        public void LuuThanhToan()
        {
            using (var scope = new TransactionScope())
            {
                try
                {
                    double?SoTienThu = double.Parse(speSoTienTT.Number.ToString());
                    if (SoTienThu == 0)
                    {
                        throw new Exception("Chưa nhập số tiền thanh toán");
                    }
                    double?SoNoHienTai = double.Parse(txtCongNoHienTai.Text);
                    if (SoTienThu > SoNoHienTai)
                    {
                        throw new Exception("Số tiền thu không được vượt qua số nợ hiện tại");
                    }

                    int      IDKhachHang = Convert.ToInt32(ccbKhachHang.Value.ToString());
                    string   SoHoaDon    = txtHoaDon.Text;
                    string   NoiDung     = memoNoiDungTT.Text;
                    DateTime NgayThu     = Formats.ConvertToDateTime(dateNgayTT.Text);
                    int      HinhThucThu = rdlHinhThuc.SelectedIndex == 0 ? 1 : 2;
                    double   CongNoCu    = double.Parse(txtCongNoHienTai.Text);


                    ghPhieuDaiLyThanhToan thanhtoan = new ghPhieuDaiLyThanhToan();
                    thanhtoan.STTPhieuThu   = DBDataProvider.STTPhieuThanhToan_DaiLy(IDKhachHang);
                    thanhtoan.SoHoaDon      = SoHoaDon;
                    thanhtoan.KhachHangID   = IDKhachHang;
                    thanhtoan.SoTienThu     = SoTienThu;
                    thanhtoan.NoiDung       = NoiDung;
                    thanhtoan.NgayThu       = NgayThu;
                    thanhtoan.NgayLap       = DateTime.Now;
                    thanhtoan.NhanVienThuID = Formats.IDUser();
                    thanhtoan.HinhThucTTID  = HinhThucThu;
                    thanhtoan.CongNoCu      = CongNoCu;

                    DBDataProvider.DB.ghPhieuDaiLyThanhToans.InsertOnSubmit(thanhtoan);
                    DBDataProvider.DB.SubmitChanges();
                    int         IDPhieuThu = thanhtoan.IDPhieuThu;
                    khKhachHang KH         = DBDataProvider.DB.khKhachHangs.Where(x => x.IDKhachHang == IDKhachHang).FirstOrDefault();
                    KH.LanCuoiMuaHang = DateTime.Now;
                    if (rdlHinhThuc.SelectedIndex == 0)
                    {
                        //Cap nhat thanh toan phieu giao hang
                        List <ghPhieuGiaoHang> ListPhieuGiaoHang = DBDataProvider.ListPhieuGiaoHang_ASC(IDKhachHang);// phiếu đã được duyệt & chưa thanh toán
                        int i = 0;
                        if (SoTienThu > 0 && ListPhieuGiaoHang.Count > 0)
                        {
                            while (SoTienThu > 0 && i < ListPhieuGiaoHang.Count)
                            {
                                double?TienNoDonHang = ListPhieuGiaoHang[i].ConLai;
                                if (SoTienThu >= TienNoDonHang)                                       //Thanh toán hết đơn hàng
                                {
                                    ListPhieuGiaoHang[i].ThanhToan   = ListPhieuGiaoHang[i].TongTien; //cập nhật lại thanh toán = tổng tiền
                                    ListPhieuGiaoHang[i].ConLai      = 0;                             // cập nhật còn lại  = 0;
                                    ListPhieuGiaoHang[i].TTThanhToan = 1;                             // đã thanh toán
                                    if (KH != null)
                                    {
                                        #region ghi nhật ký nhập kho để xem báo cáo
                                        khNhatKyCongNo nhatky = new khNhatKyCongNo();
                                        nhatky.NgayNhap    = DateTime.Now;
                                        nhatky.DienGiai    = "Thanh toán";
                                        nhatky.NoDau       = KH.CongNo;
                                        nhatky.NhapHang    = 0;
                                        nhatky.GiamGia     = 0;
                                        nhatky.TraHang     = 0;
                                        nhatky.MaPhieu     = DBDataProvider.STTPhieuThanhToan_DaiLy(IDKhachHang);
                                        nhatky.ThanhToan   = TienNoDonHang;
                                        nhatky.NoCuoi      = KH.CongNo - TienNoDonHang;
                                        nhatky.NhanVienID  = Formats.IDUser();
                                        nhatky.SoPhieu     = ListPhieuGiaoHang[i].MaPhieu;
                                        nhatky.IDKhachHang = IDKhachHang;
                                        DBDataProvider.DB.khNhatKyCongNos.InsertOnSubmit(nhatky);
                                        DBDataProvider.DB.SubmitChanges();
                                        #endregion
                                        KH.CongNo    -= TienNoDonHang; // - công nợ
                                        KH.ThanhToan += TienNoDonHang;
                                    }
                                    SoTienThu -= TienNoDonHang;
                                }
                                else // Thanh toán 1 phần đơn hàng
                                {
                                    ListPhieuGiaoHang[i].ThanhToan += SoTienThu; // cộng phần còn lại vào thanh toán.
                                    ListPhieuGiaoHang[i].ConLai     = ListPhieuGiaoHang[i].TongTien - ListPhieuGiaoHang[i].ThanhToan; // cập nhật phần còn lại
                                    //ListPhieuGiaoHang[i].TTThanhToan = 1;// đã thanh toán

                                    if (KH != null)
                                    {
                                        #region ghi nhật ký nhập kho để xem báo cáo
                                        khNhatKyCongNo nhatky = new khNhatKyCongNo();
                                        nhatky.NgayNhap    = DateTime.Now;
                                        nhatky.DienGiai    = "Thanh toán";
                                        nhatky.NoDau       = KH.CongNo;
                                        nhatky.NhapHang    = 0;
                                        nhatky.TraHang     = 0;
                                        nhatky.ThanhToan   = SoTienThu;
                                        nhatky.GiamGia     = 0;
                                        nhatky.NoCuoi      = KH.CongNo - SoTienThu;
                                        nhatky.NhanVienID  = Formats.IDUser();
                                        nhatky.MaPhieu     = DBDataProvider.STTPhieuThanhToan_DaiLy(IDKhachHang);
                                        nhatky.SoPhieu     = ListPhieuGiaoHang[i].MaPhieu;
                                        nhatky.IDKhachHang = IDKhachHang;
                                        DBDataProvider.DB.khNhatKyCongNos.InsertOnSubmit(nhatky);
                                        DBDataProvider.DB.SubmitChanges();
                                        #endregion
                                        KH.CongNo    -= SoTienThu; // - công nợ
                                        KH.ThanhToan += SoTienThu;
                                    }
                                    SoTienThu -= SoTienThu;
                                }
                                i++;
                            }
                        }
                        else
                        {
                            // trừ công nợ thẳng.

                            if (KH != null)
                            {
                                #region ghi nhật ký nhập kho để xem báo cáo
                                khNhatKyCongNo nhatky = new khNhatKyCongNo();
                                nhatky.NgayNhap    = DateTime.Now;
                                nhatky.DienGiai    = "Thanh toán";
                                nhatky.NoDau       = KH.CongNo;
                                nhatky.NhapHang    = 0;
                                nhatky.TraHang     = 0;
                                nhatky.GiamGia     = 0;
                                nhatky.ThanhToan   = SoTienThu;
                                nhatky.NoCuoi      = KH.CongNo - SoTienThu;
                                nhatky.NhanVienID  = Formats.IDUser();
                                nhatky.SoPhieu     = "";
                                nhatky.MaPhieu     = DBDataProvider.STTPhieuThanhToan_DaiLy(IDKhachHang);
                                nhatky.IDKhachHang = IDKhachHang;
                                DBDataProvider.DB.khNhatKyCongNos.InsertOnSubmit(nhatky);
                                DBDataProvider.DB.SubmitChanges();
                                #endregion
                                KH.CongNo    -= SoTienThu; // - công nợ
                                KH.ThanhToan += SoTienThu;
                            }
                        }
                    }
                    else
                    {
                        // trừ theo phiếu
                        int             IDPhieuGiaoHang = int.Parse(ccbPhieuThanhToan.Value.ToString());
                        ghPhieuGiaoHang PhieuGH         = DBDataProvider.DB.ghPhieuGiaoHangs.Single(x => x.IDPhieuGiaoHang == IDPhieuGiaoHang);

                        if (KH != null)
                        {
                            #region ghi nhật ký nhập kho để xem báo cáo
                            khNhatKyCongNo nhatky = new khNhatKyCongNo();
                            nhatky.NgayNhap    = DateTime.Now;
                            nhatky.DienGiai    = "Thanh toán";
                            nhatky.NoDau       = KH.CongNo;
                            nhatky.NhapHang    = 0;
                            nhatky.TraHang     = 0;
                            nhatky.GiamGia     = 0;
                            nhatky.MaPhieu     = DBDataProvider.STTPhieuThanhToan_DaiLy(IDKhachHang);
                            nhatky.ThanhToan   = PhieuGH.ConLai;
                            nhatky.NoCuoi      = KH.CongNo - PhieuGH.ConLai;
                            nhatky.NhanVienID  = Formats.IDUser();
                            nhatky.SoPhieu     = PhieuGH.MaPhieu;
                            nhatky.IDKhachHang = IDKhachHang;
                            DBDataProvider.DB.khNhatKyCongNos.InsertOnSubmit(nhatky);
                            DBDataProvider.DB.SubmitChanges();
                            #endregion
                            KH.CongNo    -= PhieuGH.ConLai;// - công nợ
                            KH.ThanhToan += PhieuGH.TongTien;
                        }
                        PhieuGH.ThanhToan   = PhieuGH.TongTien;
                        PhieuGH.ConLai      = 0;
                        PhieuGH.TTThanhToan = 1;
                    }

                    DBDataProvider.DB.SubmitChanges();
                    scope.Complete();
                    // Reset();
                    cbpThanhToan.JSProperties["cp_Reset"] = true;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
Example #25
0
 public static bool IsWritable(string extension)
 => Formats.Where(i => i.Extension.ToLower() == extension.ToLower()).FirstOrDefault().Writable;
Example #26
0
		public override String Show(int col, int row, Formats fo) { return value.value.ToString(); }
Example #27
0
 public static bool IsFormatSupported(string format)
 {
     return(!string.IsNullOrEmpty(format) && Formats.Contains(format, StringComparer.OrdinalIgnoreCase));
 }
 protected void gridChiTietNhapKho_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     Formats.InitDisplayIndexColumn(e);
 }
Example #29
0
        /// <summary>
        /// Query on Wolfram Alpha using the specified
        /// </summary>
        /// <param name="query">The query you would like to search for on Wolfram Alpha</param>
        /// <returns>The results of the query</returns>
        public QueryResult Query(string query)
        {
            //http://api.wolframalpha.com/v2/query?input=xx&appid=xxxxx
            RestRequest request = CreateRequest("query", query);

            //Output
            if (Formats.HasElements())
            {
                request.AddParameter("format", string.Join(",", Formats));
            }

            if (OutputUnit != Unit.NotSet)
            {
                request.AddParameter("units", OutputUnit.ToString().ToLower());
            }

            if (Assumptions.HasElements())
            {
                foreach (string assumption in Assumptions)
                {
                    request.AddParameter("assumption", assumption);
                }
            }

            //Filtering
            if (IncludePodIDs.HasElements())
            {
                foreach (string include in IncludePodIDs)
                {
                    request.AddParameter("includepodid", include);
                }
            }

            if (ExcludePodIDs.HasElements())
            {
                foreach (string exclude in ExcludePodIDs)
                {
                    request.AddParameter("excludepodid", exclude);
                }
            }

            if (PodTitles.HasElements())
            {
                foreach (string podTitle in PodTitles)
                {
                    request.AddParameter("podtitle", podTitle);
                }
            }

            if (PodIndex.HasElements())
            {
                request.AddParameter("podindex", string.Join(",", PodIndex));
            }

            if (Scanners.HasElements())
            {
                request.AddParameter("scanner", string.Join(",", Scanners));
            }

            //Timeout
            if (ParseTimeout >= Epsilon)
            {
                request.AddParameter("parsetimeout", ParseTimeout.ToString(_culture));
            }

            if (ScanTimeout >= Epsilon)
            {
                request.AddParameter("scantimeout", ScanTimeout.ToString(_culture));
            }

            if (PodTimeout >= Epsilon)
            {
                request.AddParameter("podtimeout", PodTimeout.ToString(_culture));
            }

            if (FormatTimeout >= Epsilon)
            {
                request.AddParameter("formattimeout", FormatTimeout.ToString(_culture));
            }

            //Async
            if (UseAsync)
            {
                request.AddParameter("async", UseAsync.ToString().ToLower());
            }

            //Location
            if (IpAddress != null)
            {
                request.AddParameter("ip", IpAddress.ToString());
            }

            if (!string.IsNullOrEmpty(Location))
            {
                request.AddParameter("location", Location);
            }

            if (GPSLocation != null)
            {
                request.AddParameter("latlong", GPSLocation.ToString());
            }

            //Size
            if (Width >= 1f)
            {
                request.AddParameter("width", Width);
            }

            if (MaxWidth >= 1f)
            {
                request.AddParameter("maxwidth", MaxWidth);
            }

            if (PlotWidth >= 1f)
            {
                request.AddParameter("plotwidth", PlotWidth);
            }

            if (Magnification >= 0.1f)
            {
                request.AddParameter("mag", Magnification.ToString(_culture));
            }

            //Misc
            if (!string.IsNullOrEmpty(Signature))
            {
                request.AddParameter("sig", Signature);
            }

            if (ReInterpret.HasValue)
            {
                request.AddParameter("reinterpret", ReInterpret.ToString().ToLower());
            }

            if (IgnoreCase.HasValue)
            {
                request.AddParameter("ignorecase", IgnoreCase.ToString().ToLower());
            }

            if (EnableTranslate.HasValue)
            {
                request.AddParameter("translation", EnableTranslate.ToString().ToLower());
            }

            QueryResult results = GetResponse <QueryResult>(request);

            return(results);
        }
 protected void gridNhaphang_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     Formats.InitDisplayIndexGroupColumn(sender, e);
 }
        private void Import_Temp(DataTable datatable)
        {
            int intRow = datatable.Rows.Count;

            if (datatable.Columns.Contains("Mã hàng hóa") && datatable.Columns.Contains("Tồn thực tế") && datatable.Columns.Contains("Lý do kiểm kê"))
            {
                if (intRow != 0)
                {
                    for (int i = 0; i <= intRow - 1; i++)
                    {
                        DataRow dr     = datatable.Rows[i];
                        string  MaHang = dr["Mã hàng hóa"].ToString().Trim();
                        if (MaHang != "")
                        {
                            int tblHangHoa_Count = DBDataProvider.DB.hhHangHoas.Where(x => x.MaHang == MaHang && x.DaXoa == 0).Count();
                            if (tblHangHoa_Count > 0)
                            {
                                var tblHangHoa     = DBDataProvider.DB.hhHangHoas.Where(x => x.MaHang == MaHang && x.DaXoa == 0 && x.LoaiHHID == 1).FirstOrDefault();
                                var exitProdInList = listReceiptProducts.SingleOrDefault(r => r.MaHang == MaHang);
                                if (exitProdInList == null)
                                {
                                    int TonKhoThucTe = Convert.ToInt32(dr["Tồn thực tế"] == "" ? "0" : dr["Tồn thực tế"].ToString().Trim());

                                    string DienGiai = dr["Lý do kiểm kê"] == "" ? "" : dr["Lý do kiểm kê"].ToString();
                                    oImportProduct_ChiTietKiemKe newKiemKe = new oImportProduct_ChiTietKiemKe(
                                        tblHangHoa.IDHangHoa,
                                        tblHangHoa.MaHang,
                                        tblHangHoa.TenHangHoa,
                                        Convert.ToInt32(tblHangHoa.hhTonKhos.Where(s => s.ChiNhanhID == Convert.ToInt32(Formats.IDChiNhanh())).FirstOrDefault().SoLuong),
                                        TonKhoThucTe,
                                        TonKhoThucTe - Convert.ToInt32(tblHangHoa.hhTonKhos.Where(s => s.ChiNhanhID == Convert.ToInt32(Formats.IDChiNhanh())).FirstOrDefault().SoLuong),
                                        1,
                                        DienGiai
                                        );
                                    listReceiptProducts.Add(newKiemKe);
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                throw new Exception("File excel không đúng. Vui lòng kiểm tra lại!!");
            }
        }
        protected void gridNhaphang_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            int IDNhapKho = Convert.ToInt32(e.Keys[0].ToString());

            using (var scope = new TransactionScope())
            {
                try
                {
                    var NhapKho = DBDataProvider.DB.kNhapKhos.Where(x => x.IDNhapKho == IDNhapKho).FirstOrDefault();
                    if (NhapKho != null)
                    {
                        if (NhapKho.TrangThaiPhieu == 0)
                        {
                            NhapKho.TrangThaiPhieu = 2;
                            khKhachHang kh = DBDataProvider.DB.khKhachHangs.Where(x => x.IDKhachHang == NhapKho.NCCID).FirstOrDefault();
                            if (NhapKho.CongNo > 0) // cập nhật công nợ + ghi nhật ký
                            {
                                #region ghi nhật ký nhập kho để xem báo cáo
                                khNhatKyCongNo nhatky = new khNhatKyCongNo();
                                nhatky.NgayNhap    = DateTime.Now;
                                nhatky.DienGiai    = "Xóa phiếu nhập kho";
                                nhatky.NoDau       = kh.CongNo;
                                nhatky.NhapHang    = 0;
                                nhatky.TraHang     = NhapKho.CongNo;
                                nhatky.NoCuoi      = kh.CongNo - NhapKho.CongNo;
                                nhatky.ThanhToan   = 0;
                                nhatky.NhanVienID  = Formats.IDUser();
                                nhatky.SoPhieu     = NhapKho.MaPhieu;
                                nhatky.IDKhachHang = NhapKho.NCCID;
                                DBDataProvider.DB.khNhatKyCongNos.InsertOnSubmit(nhatky);
                                DBDataProvider.DB.SubmitChanges();
                                #endregion

                                kh.TongTienHang  -= NhapKho.TongTien;
                                kh.CongNo        -= NhapKho.CongNo;
                                kh.LanCuoiMuaHang = DateTime.Now;
                            }
                            else
                            {
                                kh.TongTienHang  -= NhapKho.TongTien;
                                kh.CongNo        -= NhapKho.CongNo;
                                kh.LanCuoiMuaHang = DateTime.Now;
                            }

                            List <kNhapKhoChiTiet> nhapkho = DBDataProvider.NhapKhoChiTiet(IDNhapKho);
                            foreach (var nk in nhapkho)
                            {
                                int IDHangHoa = Convert.ToInt32(nk.HangHoaID);
                                int SoLuong   = Convert.ToInt32(nk.SoLuong);

                                var HangHoa = DBDataProvider.DB.hhHangHoas.Where(x => x.IDHangHoa == IDHangHoa).FirstOrDefault();
                                if (HangHoa != null)
                                {
                                    //// trừ tồn kho,
                                    //HangHoa.TonKho -= SoLuong;
                                    //ghi thẻ kho
                                    #region ghi thẻ kho
                                    kTheKho thekho = new kTheKho();
                                    thekho.NgayNhap   = DateTime.Now;
                                    thekho.DienGiai   = "Xóa phiếu nhập hàng #" + NhapKho.MaPhieu;
                                    thekho.Nhap       = 0;
                                    thekho.Xuat       = SoLuong;
                                    thekho.Ton        = HangHoa.TonKho -= SoLuong; // trừ tồn kho luôn
                                    thekho.HangHoaID  = IDHangHoa;
                                    thekho.NhanVienID = Formats.IDUser();
                                    DBDataProvider.DB.kTheKhos.InsertOnSubmit(thekho);
                                    #endregion
                                }
                            }
                            DBDataProvider.DB.SubmitChanges();
                            scope.Complete();
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            gridNhaphang.CancelEdit();
            e.Cancel = true;
            gridNhaphang.DataBind();
        }
Example #33
0
 public Decoder(Formats format = Formats.DXT1)
 {
     Format = format;
 }
        private void Save()
        {
            using (var scope = new TransactionScope())
            {
                try
                {
                    if (listReceiptProducts.Count > 0)
                    {
                        double TongTien    = 0;
                        int    TongSoLuong = 0;
                        foreach (var prod in listReceiptProducts)
                        {
                            TongTien    += prod.ThanhTien;
                            TongSoLuong += prod.SoLuong;
                        }

                        string MaPhieu = null, strMaPhieu = "PX";
                        string MAX = (DBDataProvider.DB.kPhieuTraHangNCCs.Count() + 1).ToString();
                        for (int i = 1; i < (7 - MAX.Length); i++)
                        {
                            strMaPhieu += "0";
                        }
                        MaPhieu = strMaPhieu + MAX;
                        int IDNCC     = Int32.Parse(ccbNhaCungCap.Value.ToString());
                        int IDSoPhieu = 0;
                        if (ccbSoPhieu.Text != "")
                        {
                            IDSoPhieu = Int32.Parse(ccbSoPhieu.Value.ToString());
                        }

                        // insert kPhieuTraHangNCC
                        kPhieuTraHangNCC phieutra = new kPhieuTraHangNCC();
                        phieutra.MaPhieu      = MaPhieu;
                        phieutra.NhaCungCapID = IDNCC;
                        phieutra.SoPhieuTra   = IDSoPhieu;
                        phieutra.NgayTra      = Convert.ToDateTime(dateNgayTra.Date);
                        phieutra.NgayNhap     = DateTime.Now;
                        phieutra.NhanVienID   = Formats.IDUser();
                        phieutra.GhiChu       = memoGhiChu.Text;
                        phieutra.TongSoLuong  = TongSoLuong;
                        phieutra.TongTienHang = TongTien;
                        phieutra.ThanhToan    = ckGiamCongNo.Checked == true ? 0 : TongTien;
                        phieutra.STTDonHang   = DBDataProvider.STTPhieuTraHang_NCC(IDNCC);
                        phieutra.ConLai       = ckGiamCongNo.Checked == true ? TongTien : 0;
                        phieutra.HinhThucTT   = ckGiamCongNo.Checked == true ? 1 : 0;
                        DBDataProvider.DB.kPhieuTraHangNCCs.InsertOnSubmit(phieutra);
                        DBDataProvider.DB.SubmitChanges();
                        int IDPhieuTraHang = phieutra.IDPhieuTraHang;
                        foreach (var prod in listReceiptProducts)
                        {
                            // insert Chi tiet
                            kPhieuTraHangNCCChiTiet chitiet = new kPhieuTraHangNCCChiTiet();
                            chitiet.PhieuTraHangNCCID = IDPhieuTraHang;
                            chitiet.HangHoaID         = prod.IDHangHoa;
                            chitiet.GiaVon            = prod.GiaVon;
                            chitiet.SoLuong           = prod.SoLuong;
                            chitiet.ThanhTien         = prod.ThanhTien;
                            chitiet.TonKho            = prod.TonKho;
                            chitiet.TienTra           = prod.TienTra;
                            DBDataProvider.DB.kPhieuTraHangNCCChiTiets.InsertOnSubmit(chitiet);
                            //Cập nhật || trừ tồn kho
                            var TonKhoBanDau = DBDataProvider.DB.hhHangHoas.Where(x => x.IDHangHoa == prod.IDHangHoa).FirstOrDefault();
                            if (TonKhoBanDau != null)
                            {
                                TonKhoBanDau.hhTonKhos.Where(s => s.ChiNhanhID == Formats.IDChiNhanh()).FirstOrDefault().SoLuong -= prod.SoLuong;
                                #region ghi thẻ kho
                                kTheKho thekho = new kTheKho();
                                thekho.NgayNhap    = DateTime.Now;
                                thekho.DienGiai    = "Trả hàng NCC #" + MaPhieu;
                                thekho.Nhap        = 0;
                                thekho.GiaThoiDiem = prod.TienTra;
                                thekho.Xuat        = prod.SoLuong;
                                thekho.ChiNhanhID  = Formats.IDChiNhanh();
                                thekho.Ton         = prod.TonKho - prod.SoLuong;
                                thekho.HangHoaID   = TonKhoBanDau.IDHangHoa;
                                thekho.NhanVienID  = Formats.IDUser();
                                DBDataProvider.DB.kTheKhos.InsertOnSubmit(thekho);
                                #endregion
                            }
                        }
                        //update công nợ
                        khKhachHang Supplier = DBDataProvider.DB.khKhachHangs.Where(x => x.IDKhachHang == IDNCC).FirstOrDefault();
                        if (Supplier != null)
                        {
                            #region ghi nhật ký nhập kho để xem báo cáo

                            khNhatKyCongNo nhatky = new khNhatKyCongNo();
                            nhatky.NgayNhap    = DateTime.Now;
                            nhatky.DienGiai    = "Trả hàng NCC ";
                            nhatky.NoDau       = Supplier.CongNo;
                            nhatky.NhapHang    = 0;
                            nhatky.TraHang     = TongTien;
                            nhatky.NoCuoi      = Supplier.CongNo - (ckGiamCongNo.Checked == true ? TongTien : 0);
                            nhatky.ThanhToan   = 0;
                            nhatky.NhanVienID  = Formats.IDUser();
                            nhatky.SoPhieu     = MaPhieu;
                            nhatky.IDKhachHang = IDNCC;
                            DBDataProvider.DB.khNhatKyCongNos.InsertOnSubmit(nhatky);
                            DBDataProvider.DB.SubmitChanges();

                            Supplier.CongNo        -= ckGiamCongNo.Checked == true ? TongTien : 0;
                            Supplier.LanCuoiMuaHang = DateTime.Now;

                            Supplier.TienTraHang += TongTien;
                            #endregion
                            phieutra.CongNoCu = Supplier.CongNo;
                        }

                        DBDataProvider.DB.SubmitChanges();
                        scope.Complete();
                        Reset();
                        cbpInfoImport.JSProperties["cp_Reset"] = true;
                    }
                    else
                    {
                        throw new Exception("Danh sách hàng hóa trống !!");
                        ccbBarcode.Text  = "";
                        ccbBarcode.Value = "";
                        ccbBarcode.Focus();
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
        protected void Save()
        {
            using (var scope = new TransactionScope())
            {
                try
                {
                    if (listReceiptProducts.Count > 0)
                    {
                        double TongTien    = 0;
                        int    TongSoLuong = 0;
                        foreach (var prod in listReceiptProducts)
                        {
                            TongTien    += prod.ThanhTien;
                            TongSoLuong += prod.SoLuong;
                        }
                        string MaPhieu = null, strMaPhieu = "PX";
                        string MAX = (DBDataProvider.DB.ghPhieuGiaoHangs.Count() + 1).ToString();
                        for (int i = 1; i < (7 - MAX.Length); i++)
                        {
                            strMaPhieu += "0";
                        }
                        MaPhieu = strMaPhieu + MAX;

                        int             IDkhachHang = Int32.Parse(ccbNhaCungCap.Value.ToString());
                        var             KH          = DBDataProvider.DB.khKhachHangs.Where(x => x.IDKhachHang == IDkhachHang).FirstOrDefault();
                        ghPhieuGiaoHang giaohang    = new ghPhieuGiaoHang();
                        giaohang.NgayTao           = DateTime.Now;
                        giaohang.MaPhieu           = MaPhieu;
                        giaohang.NhanVienID        = Formats.IDUser();
                        giaohang.GhiChuGiaoHang    = memoGhiChu.Text;
                        giaohang.KhachHangID       = IDkhachHang;
                        giaohang.NgayGiao          = Formats.ConvertToDateTime(dateNgayNhap.Text);
                        giaohang.NguoiGiao         = "";
                        giaohang.DiaChiGiaoHang    = KH.DiaChi;
                        giaohang.DaXoa             = 0;
                        giaohang.TTThanhToan       = 0; //0 chưa thanh toán. 1 đã thanh toán
                        giaohang.TrangThai         = 3; // chưa duyệt, 1 đã duyệt, 3 bán hàng
                        giaohang.TongSoLuong       = TongSoLuong;
                        giaohang.DienThoai         = KH.DienThoai;
                        giaohang.TongTien          = TongTien;
                        giaohang.NgayDuyet         = DateTime.Parse(dateNgayNhap.Text);
                        giaohang.GiamGia           = Convert.ToDouble(spGiamGia.Number);
                        giaohang.ThanhToan         = Convert.ToDouble(spKhachHangThoan.Number);                                                   // khách thanh toán
                        giaohang.ConLai            = TongTien - (Convert.ToDouble(spGiamGia.Number) + Convert.ToDouble(spKhachHangThoan.Number)); // (-1)*Convert.ToDouble(spTienTraKhach.Number);
                        giaohang.STTDonHang        = DBDataProvider.STTPhieuGiaoHang_DaiLy(IDkhachHang);
                        giaohang.SoDonHangTrongNam = DBDataProvider.SoDonHangTrongNam_GiaoHang();
                        giaohang.CongNoHienTai     = KH.CongNo;
                        DBDataProvider.DB.ghPhieuGiaoHangs.InsertOnSubmit(giaohang);
                        DBDataProvider.DB.SubmitChanges();
                        int IDPhieuGiaoHang = giaohang.IDPhieuGiaoHang;
                        hiddenFields["IDPhieuMoi"] = IDPhieuGiaoHang;
                        foreach (var prod in listReceiptProducts)
                        {
                            // insert phiếu giao hàng chi tiết
                            ghPhieuGiaoHangChiTiet chitiet = new ghPhieuGiaoHangChiTiet();
                            chitiet.PhieuGiaoHangID = IDPhieuGiaoHang;
                            chitiet.HangHoaID       = prod.IDHangHoa;
                            chitiet.TonKho          = prod.TonKho;
                            chitiet.SoLuong         = prod.SoLuong;
                            chitiet.GiaBan          = prod.GiaBan;
                            chitiet.GiaVon          = prod.GiaVon;
                            chitiet.ThanhTien       = prod.ThanhTien;
                            DBDataProvider.DB.ghPhieuGiaoHangChiTiets.InsertOnSubmit(chitiet);
                            // trừ tạm tồn kho.
                            var TonKhoBanDau = DBDataProvider.DB.hhHangHoas.Where(x => x.IDHangHoa == prod.IDHangHoa).FirstOrDefault();
                            if (TonKhoBanDau != null)
                            {
                                TonKhoBanDau.TonKho -= prod.SoLuong;
                                var HH = DBDataProvider.DB.hhHangHoas.Where(x => x.IDHangHoa == prod.IDHangHoa).FirstOrDefault();
                                //ghi thẻ kho
                                #region thẻ kho
                                kTheKho thekho = new kTheKho();
                                thekho.NgayNhap    = DateTime.Now;
                                thekho.DienGiai    = "Bán hàng #" + giaohang.MaPhieu;
                                thekho.Nhap        = 0;
                                thekho.Xuat        = prod.SoLuong;
                                thekho.Ton         = HH.TonKho;
                                thekho.GiaThoiDiem = prod.GiaBan;
                                thekho.HangHoaID   = HH.IDHangHoa;
                                thekho.NhanVienID  = Formats.IDUser();
                                DBDataProvider.DB.kTheKhos.InsertOnSubmit(thekho);
                                #endregion
                            }
                        }



                        if (Convert.ToDouble(spTienTraKhach.Number) < 0)
                        {
                            // cập nhật công nợ
                            #region nhật ký công nợ
                            khNhatKyCongNo nhatky = new khNhatKyCongNo();
                            nhatky.NgayNhap    = DateTime.Now;
                            nhatky.DienGiai    = "Bán hàng";
                            nhatky.NoDau       = KH.CongNo;
                            nhatky.NhapHang    = TongTien;
                            nhatky.TraHang     = 0;
                            nhatky.GiamGia     = Convert.ToDouble(spGiamGia.Number);
                            nhatky.NoCuoi      = KH.CongNo += (-1) * Convert.ToDouble(spTienTraKhach.Number);
                            nhatky.ThanhToan   = Convert.ToDouble(spKhachHangThoan.Number);
                            nhatky.MaPhieu     = DBDataProvider.STTPhieuGiaoHang_DaiLy(IDkhachHang);
                            nhatky.NhanVienID  = Formats.IDUser();
                            nhatky.SoPhieu     = giaohang.MaPhieu;
                            nhatky.IDKhachHang = IDkhachHang;
                            DBDataProvider.DB.khNhatKyCongNos.InsertOnSubmit(nhatky);
                            DBDataProvider.DB.SubmitChanges();
                            #endregion
                            // KH.CongNo += (-1) * Convert.ToDouble(spTienTraKhach.Number); // cộng công nợ
                        }
                        else
                        {
                            #region nhật ký công nợ
                            khNhatKyCongNo nhatky = new khNhatKyCongNo();
                            nhatky.NgayNhap    = DateTime.Now;
                            nhatky.DienGiai    = "Bán hàng";
                            nhatky.NoDau       = KH.CongNo;
                            nhatky.NhapHang    = TongTien;
                            nhatky.GiamGia     = Convert.ToDouble(spGiamGia.Number);
                            nhatky.TraHang     = 0;
                            nhatky.NoCuoi      = KH.CongNo;
                            nhatky.ThanhToan   = Convert.ToDouble(spKhachHangThoan.Number);
                            nhatky.MaPhieu     = DBDataProvider.STTPhieuGiaoHang_DaiLy(IDkhachHang);
                            nhatky.NhanVienID  = Formats.IDUser();
                            nhatky.SoPhieu     = giaohang.MaPhieu;
                            nhatky.IDKhachHang = IDkhachHang;
                            DBDataProvider.DB.khNhatKyCongNos.InsertOnSubmit(nhatky);
                            DBDataProvider.DB.SubmitChanges();
                            #endregion
                        }

                        KH.TongTienHang  += TongTien;
                        KH.LanCuoiMuaHang = DateTime.Now;

                        DBDataProvider.DB.SubmitChanges();
                        scope.Complete();
                        Reset();
                        cbpInfoImport.JSProperties["cp_Reset"] = true;
                    }
                    else
                    {
                        throw new Exception("Danh sách hàng hóa trống !!");
                        ccbBarcode.Text  = "";
                        ccbBarcode.Value = "";
                        ccbBarcode.Focus();
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
        public void Insert_Hang(int ID)
        {
            int tblHangHoa_Count = DBDataProvider.DB.hhHangHoas.Where(x => x.IDHangHoa == ID && x.DaXoa == 0 && x.LoaiHHID == 1).Count();

            if (tblHangHoa_Count > 0)
            {
                var tblHangHoa     = DBDataProvider.DB.hhHangHoas.Where(x => x.IDHangHoa == ID && x.DaXoa == 0).FirstOrDefault();
                int SoLuong        = Convert.ToInt32(spSoLuong.Number);
                var exitProdInList = listReceiptProducts.SingleOrDefault(r => r.IDHangHoa == ID);
                if (exitProdInList == null)
                {
                    oImportProduct_TraHangNCC newRecpPro = new oImportProduct_TraHangNCC(
                        tblHangHoa.IDHangHoa,
                        tblHangHoa.MaHang,
                        tblHangHoa.TenHangHoa,
                        Convert.ToDouble(tblHangHoa.GiaVon),
                        Convert.ToInt32(tblHangHoa.hhTonKhos.Where(s => s.ChiNhanhID == Convert.ToInt32(Formats.IDChiNhanh())).FirstOrDefault().SoLuong),
                        SoLuong, SoLuong * Convert.ToDouble(tblHangHoa.GiaVon), Convert.ToDouble(tblHangHoa.GiaVon),
                        tblHangHoa.hhDonViTinh.TenDonViTinh
                        );
                    listReceiptProducts.Add(newRecpPro);
                }
                else
                {
                    exitProdInList.SoLuong  += SoLuong;
                    exitProdInList.ThanhTien = exitProdInList.SoLuong * exitProdInList.TienTra;
                }
                UpdateSTT();
            }
            else
            {
                ccbBarcode.Value = "";
                ccbBarcode.Text  = "";
                ccbBarcode.Focus();
                spSoLuong.Number = 1;
                throw new Exception("Mã hàng không tồn tại !!");
            }
        }
 protected void gridDanhSachKH_CustomColumnDisplayText(object sender, DevExpress.Web.ASPxGridViewColumnDisplayTextEventArgs e)
 {
     Formats.InitDisplayIndexColumn(e);
 }
Example #38
0
        /// <summary>
        /// Define this instance.
        /// </summary>
        public override void Define()
        {
            // Call base class
            base.Define();

            // Value Types
            // Keywords.Add("", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, ""));
            Keywords.Add("bool", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "It is used to declare variables to store the Boolean values, true and false."));
            Keywords.Add("byte", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "The byte keyword denotes an integral type that stores values between 0 to 255."));
            Keywords.Add("char", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "The char keyword is used to declare an instance of the System.Char structure that the .NET Framework uses to represent a Unicode character."));
            Keywords.Add("decimal", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "The decimal keyword denotes an integral type that stores values between (-7.9 x 10^28 to 7.9 x 10^28) / (10^(0 to 28))."));
            Keywords.Add("double", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "The double keyword signifies a simple type that stores 64-bit floating-point values."));
            Keywords.Add("enum", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "The enum keyword is used to declare an enumeration, a distinct type that consists of a set of named constants called the enumerator list."));
            Keywords.Add("float", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "The float keyword signifies a simple type that stores 32-bit floating-point values. "));
            Keywords.Add("int", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "The int keyword denotes an integral type that stores values between -2,147,483,648 to 2,147,483,647."));
            Keywords.Add("long", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "The long keyword denotes an integral type that stores values between –9,223,372,036,854,775,808 to 9,223,372,036,854,775,807."));
            Keywords.Add("sbyte", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "The sbyte keyword indicates an integral type that stores values between -128 to 127."));
            Keywords.Add("short", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "The short keyword denotes an integral data type that stores values between -32,768 to 32,767."));
            Keywords.Add("struct", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "A struct type is a value type that is typically used to encapsulate small groups of related variables, such as the coordinates of a rectangle or the characteristics of an item in an inventory."));
            Keywords.Add("uint", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "The uint keyword signifies an integral type that stores values between 0 to 4,294,967,295."));
            Keywords.Add("ulong", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "The ulong keyword denotes an integral type that stores values between 0 to 18,446,744,073,709,551,615."));
            Keywords.Add("ushort", new KeywordDescriptor(KeywordType.ValueType, ValueTypeColor, "The ushort keyword indicates an integral data type that stores values between 0 to 65,535."));

            // Reference Types
            // Keywords.Add("", new KeywordDescriptor(KeywordType.ReferenceType, ReferenceTypeColor, ""));
            Keywords.Add("class", new KeywordDescriptor(KeywordType.ReferenceType, ReferenceTypeColor, "Classes are declared using the keyword class."));
            Keywords.Add("delegate", new KeywordDescriptor(KeywordType.ReferenceType, ReferenceTypeColor, "The declaration of a delegate type is similar to a method signature. It has a return value and any number of parameters of any type."));
            Keywords.Add("dynamic", new KeywordDescriptor(KeywordType.ReferenceType, ReferenceTypeColor, "The dynamic type enables the operations in which it occurs to bypass compile-time type checking. Instead, these operations are resolved at run time."));
            Keywords.Add("interface", new KeywordDescriptor(KeywordType.ReferenceType, ReferenceTypeColor, "An interface contains only the signatures of methods, properties, events or indexers. "));
            Keywords.Add("object", new KeywordDescriptor(KeywordType.ReferenceType, ReferenceTypeColor, "In the unified type system of C#, all types, predefined and user-defined, reference types and value types, inherit directly or indirectly from Object. You can assign values of any type to variables of type object. "));
            Keywords.Add("string", new KeywordDescriptor(KeywordType.ReferenceType, ReferenceTypeColor, "The string type represents a sequence of zero or more Unicode characters. string is an alias for String in the .NET Framework."));

            // Generic Types
            // Keywords.Add("", new KeywordDescriptor(KeywordType.Type, TypeColor, ""));
            Keywords.Add("void", new KeywordDescriptor(KeywordType.Type, TypeColor, "When used as the return type for a method, void specifies that the method doesn't return a value."));
            Keywords.Add("var", new KeywordDescriptor(KeywordType.Type, TypeColor, "An implicitly typed local variable is strongly typed just as if you had declared the type yourself, but the compiler determines the type."));

            // Access modifiers
            // Keywords.Add("", new KeywordDescriptor(KeywordType.AccessModifier, AccessModifierColor, ""));
            Keywords.Add("public", new KeywordDescriptor(KeywordType.AccessModifier, AccessModifierColor, "The public keyword is an access modifier for types and type members. There are no restrictions on accessing public members."));
            Keywords.Add("private", new KeywordDescriptor(KeywordType.AccessModifier, AccessModifierColor, "Private members are accessible only within the body of the class or the struct in which they are declared."));
            Keywords.Add("internal", new KeywordDescriptor(KeywordType.AccessModifier, AccessModifierColor, "Internal types or members are accessible only within files in the same assembly."));
            Keywords.Add("protected", new KeywordDescriptor(KeywordType.AccessModifier, AccessModifierColor, "A protected member is accessible within its class and by derived class instances."));

            // Modifiers
            // Keywords.Add("", new KeywordDescriptor(KeywordType.Modifier, ModifierColor, ""));
            Keywords.Add("abstract", new KeywordDescriptor(KeywordType.Modifier, ModifierColor, "The abstract modifier indicates that the thing being modified has a missing or incomplete implementation."));
            Keywords.Add("async", new KeywordDescriptor(KeywordType.Modifier, ModifierColor, "Use the async modifier to specify that a method, lambda expression, or anonymous method is asynchronous. "));
            Keywords.Add("const", new KeywordDescriptor(KeywordType.Modifier, ModifierColor, "You use the const keyword to declare a constant field or a constant local. Constant fields and locals aren't variables and may not be modified. "));
            Keywords.Add("event", new KeywordDescriptor(KeywordType.Modifier, ModifierColor, "The event keyword is used to declare an event in a publisher class."));
            Keywords.Add("extern", new KeywordDescriptor(KeywordType.Modifier, ModifierColor, "The extern modifier is used to declare a method that is implemented externally. "));
            Keywords.Add("in", new KeywordDescriptor(KeywordType.Modifier, ModifierColor, "For generic type parameters, the in keyword specifies that the type parameter is contravariant. You can use the in keyword in generic interfaces and delegates."));
            Keywords.Add("override", new KeywordDescriptor(KeywordType.Modifier, ModifierColor, "The override modifier is required to extend or modify the abstract or virtual implementation of an inherited method, property, indexer, or event."));
            Keywords.Add("readonly", new KeywordDescriptor(KeywordType.Modifier, ModifierColor, "When a field declaration includes a readonly modifier, assignments to the fields introduced by the declaration can only occur as part of the declaration or in a constructor in the same class."));
            Keywords.Add("sealed", new KeywordDescriptor(KeywordType.Modifier, ModifierColor, "When applied to a class, the sealed modifier prevents other classes from inheriting from it."));
            Keywords.Add("static", new KeywordDescriptor(KeywordType.Modifier, ModifierColor, "Use the static modifier to declare a static member, which belongs to the type itself rather than to a specific object. "));
            Keywords.Add("unsafe", new KeywordDescriptor(KeywordType.Modifier, ModifierColor, "The unsafe keyword denotes an unsafe context, which is required for any operation involving pointers."));
            Keywords.Add("virtual", new KeywordDescriptor(KeywordType.Modifier, ModifierColor, "The virtual keyword is used to modify a method, property, indexer, or event declaration and allow for it to be overridden in a derived class. "));
            Keywords.Add("volatile", new KeywordDescriptor(KeywordType.Modifier, ModifierColor, "The volatile keyword indicates that a field might be modified by multiple threads that are executing at the same time. "));

            // Selection Statements
            // Keywords.Add("", new KeywordDescriptor(KeywordType.SelectionStatement, SelectionStatementColor, ""));
            Keywords.Add("if", new KeywordDescriptor(KeywordType.SelectionStatement, SelectionStatementColor, "An if statement identifies which statement to run based on the value of a Boolean expression."));
            Keywords.Add("else", new KeywordDescriptor(KeywordType.SelectionStatement, SelectionStatementColor, "In an if-else statement, if condition evaluates to true, the then-statement runs. If condition is false, the else-statement runs. "));
            Keywords.Add("switch", new KeywordDescriptor(KeywordType.SelectionStatement, SelectionStatementColor, "The switch statement is a control statement that selects a switch section to execute from a list of candidates."));
            Keywords.Add("case", new KeywordDescriptor(KeywordType.SelectionStatement, SelectionStatementColor, "Each case label specifies a constant value."));
            Keywords.Add("default", new KeywordDescriptor(KeywordType.SelectionStatement, SelectionStatementColor, "f no case label contains a matching value, control is transferred to the default section, if there is one."));

            // Iteration Statements
            // Keywords.Add("", new KeywordDescriptor(KeywordType.IterationStatement, IterationStatementColor, ""));
            Keywords.Add("do", new KeywordDescriptor(KeywordType.IterationStatement, IterationStatementColor, "The do statement executes a statement or a block of statements repeatedly until a specified expression evaluates to false. "));
            Keywords.Add("for", new KeywordDescriptor(KeywordType.IterationStatement, IterationStatementColor, "By using a for loop, you can run a statement or a block of statements repeatedly until a specified expression evaluates to false."));
            Keywords.Add("foreach", new KeywordDescriptor(KeywordType.IterationStatement, IterationStatementColor, "The foreach statement repeats a group of embedded statements for each element in an array or an object collection that implements the System.Collections.IEnumerable or System.Collections.Generic.IEnumerable<T> interface. "));
            Keywords.Add("while", new KeywordDescriptor(KeywordType.IterationStatement, IterationStatementColor, "The while statement executes a statement or a block of statements until a specified expression evaluates to false."));

            // Jump Statements
            // Keywords.Add("", new KeywordDescriptor(KeywordType.JumpStatement, JumpStatementColor, ""));
            Keywords.Add("break", new KeywordDescriptor(KeywordType.JumpStatement, JumpStatementColor, "The break statement terminates the closest enclosing loop or switch statement in which it appears. Control is passed to the statement that follows the terminated statement, if any."));
            Keywords.Add("continue", new KeywordDescriptor(KeywordType.JumpStatement, JumpStatementColor, "The continue statement passes control to the next iteration of the enclosing while, do, for, or foreach statement in which it appears."));
            Keywords.Add("goto", new KeywordDescriptor(KeywordType.JumpStatement, JumpStatementColor, "The goto statement transfers the program control directly to a labeled statement."));
            Keywords.Add("return", new KeywordDescriptor(KeywordType.JumpStatement, JumpStatementColor, "The return statement terminates execution of the method in which it appears and returns control to the calling method. It can also return an optional value."));

            // Exception Handling Statements
            // Keywords.Add("", new KeywordDescriptor(KeywordType.ExceptionHandlingStatement, ExceptionHandlingColor, ""));
            Keywords.Add("throw", new KeywordDescriptor(KeywordType.ExceptionHandlingStatement, ExceptionHandlingColor, "The throw statement is used to signal the occurrence of an anomalous situation (exception) during the program execution."));
            Keywords.Add("try", new KeywordDescriptor(KeywordType.ExceptionHandlingStatement, ExceptionHandlingColor, "The try-catch statement consists of a try block followed by one or more catch clauses, which specify handlers for different exceptions."));
            Keywords.Add("catch", new KeywordDescriptor(KeywordType.ExceptionHandlingStatement, ExceptionHandlingColor, "The try-catch statement consists of a try block followed by one or more catch clauses, which specify handlers for different exceptions."));
            Keywords.Add("finally", new KeywordDescriptor(KeywordType.ExceptionHandlingStatement, ExceptionHandlingColor, "A common usage of catch and finally together is to obtain and use resources in a try block, deal with exceptional circumstances in a catch block, and release the resources in the finally block."));

            // Statements
            // Keywords.Add("", new KeywordDescriptor(KeywordType.Statement, StatementColor, ""));
            Keywords.Add("checked", new KeywordDescriptor(KeywordType.Statement, StatementColor, "The checked keyword is used to explicitly enable overflow checking for integral-type arithmetic operations and conversions."));
            Keywords.Add("unchecked", new KeywordDescriptor(KeywordType.Statement, StatementColor, "The unchecked keyword is used to suppress overflow-checking for integral-type arithmetic operations and conversions."));
            Keywords.Add("fixed", new KeywordDescriptor(KeywordType.Statement, StatementColor, "The fixed statement prevents the garbage collector from relocating a movable variable. The fixed statement is only permitted in an unsafe context."));
            Keywords.Add("lock", new KeywordDescriptor(KeywordType.Statement, StatementColor, "The lock keyword marks a statement block as a critical section by obtaining the mutual-exclusion lock for a given object, executing a statement, and then releasing the lock."));

            // Method Parameters
            // Keywords.Add("", new KeywordDescriptor(KeywordType.MethodParameters, MethodParameterColor, ""));
            Keywords.Add("params", new KeywordDescriptor(KeywordType.MethodParameters, MethodParameterColor, "By using the params keyword, you can specify a method parameter that takes a variable number of arguments."));
            Keywords.Add("ref", new KeywordDescriptor(KeywordType.MethodParameters, MethodParameterColor, "The ref keyword causes an argument to be passed by reference, not by value."));
            Keywords.Add("out", new KeywordDescriptor(KeywordType.MethodParameters, MethodParameterColor, "The out keyword causes arguments to be passed by reference. This is like the ref keyword, except that ref requires that the variable be initialized before it is passed. "));

            // Namespace Keywords
            // Keywords.Add("", new KeywordDescriptor(KeywordType.NamespaceKeyword, NamespaceColor, ""));
            Keywords.Add("namespace", new KeywordDescriptor(KeywordType.NamespaceKeyword, NamespaceColor, "The namespace keyword is used to declare a scope that contains a set of related objects."));
            Keywords.Add("using", new KeywordDescriptor(KeywordType.MethodParameters, NamespaceColor, "Allows the use of types in a namespace so that you do not have to qualify the use of a type in that namespace."));

            // Operator Keywords
            // Keywords.Add("", new KeywordDescriptor(KeywordType.OperatorKeyword, OperatorKeywordColor, ""));
            Keywords.Add("as", new KeywordDescriptor(KeywordType.OperatorKeyword, OperatorKeywordColor, "You can use the as operator to perform certain types of conversions between compatible reference types or nullable types."));
            Keywords.Add("await", new KeywordDescriptor(KeywordType.OperatorKeyword, OperatorKeywordColor, "The await operator is applied to a task in an asynchronous method to suspend the execution of the method until the awaited task completes."));
            Keywords.Add("is", new KeywordDescriptor(KeywordType.OperatorKeyword, OperatorKeywordColor, "Checks if an object is compatible with a given type."));
            Keywords.Add("new", new KeywordDescriptor(KeywordType.OperatorKeyword, OperatorKeywordColor, "Used to create objects and invoke constructors."));
            Keywords.Add("sizeof", new KeywordDescriptor(KeywordType.OperatorKeyword, OperatorKeywordColor, "Used to obtain the size in bytes for an unmanaged type."));
            Keywords.Add("typeof", new KeywordDescriptor(KeywordType.OperatorKeyword, OperatorKeywordColor, "Used to obtain the System.Type object for a type."));
            Keywords.Add("true", new KeywordDescriptor(KeywordType.OperatorKeyword, OperatorKeywordColor, "Represents the boolean value true."));
            Keywords.Add("false", new KeywordDescriptor(KeywordType.OperatorKeyword, OperatorKeywordColor, "Represents the boolean value false."));
            Keywords.Add("stackalloc", new KeywordDescriptor(KeywordType.OperatorKeyword, OperatorKeywordColor, "The stackalloc keyword is used in an unsafe code context to allocate a block of memory on the stack."));
            Keywords.Add("nameof", new KeywordDescriptor(KeywordType.OperatorKeyword, OperatorKeywordColor, "Used to obtain the simple (unqualified) string name of a variable, type, or member. "));

            // Conversion Keywords
            // Keywords.Add("", new KeywordDescriptor(KeywordType.ConversionKeyword, ConversionKeywordColor, ""));
            Keywords.Add("explicit", new KeywordDescriptor(KeywordType.ConversionKeyword, ConversionKeywordColor, "The explicit keyword declares a user-defined type conversion operator that must be invoked with a cast. "));
            Keywords.Add("implicit", new KeywordDescriptor(KeywordType.ConversionKeyword, ConversionKeywordColor, "The implicit keyword is used to declare an implicit user-defined type conversion operator. "));
            Keywords.Add("operator", new KeywordDescriptor(KeywordType.ConversionKeyword, ConversionKeywordColor, "Use the operator keyword to overload a built-in operator or to provide a user-defined conversion in a class or struct declaration."));

            // Access Keywords
            // Keywords.Add("", new KeywordDescriptor(KeywordType.AccessKeywords, AccessKeywordColor, ""));
            Keywords.Add("base", new KeywordDescriptor(KeywordType.AccessKeywords, AccessKeywordColor, "Accesses the members of the base class."));
            Keywords.Add("this", new KeywordDescriptor(KeywordType.AccessKeywords, AccessKeywordColor, "Refers to the current instance of the class."));

            // Literal Keywords
            // Keywords.Add("", new KeywordDescriptor(KeywordType.LiteralKeywords, LiteralKeywordColor, ""));
            Keywords.Add("null", new KeywordDescriptor(KeywordType.LiteralKeywords, LiteralKeywordColor, "The null keyword is a literal that represents a null reference, one that does not refer to any object. null is the default value of reference-type variables."));

            // Contextual Keywords
            // Keywords.Add("", new KeywordDescriptor(KeywordType.ContextualKeywords, ContextualKeywordColor, ""));
            Keywords.Add("add", new KeywordDescriptor(KeywordType.ContextualKeywords, ContextualKeywordColor, "The add contextual keyword is used to define a custom event accessor that is invoked when client code subscribes to your event."));
            Keywords.Add("get", new KeywordDescriptor(KeywordType.ContextualKeywords, ContextualKeywordColor, "The get keyword defines an accessor method in a property or indexer that retrieves the value of the property or the indexer element."));
            Keywords.Add("global", new KeywordDescriptor(KeywordType.ContextualKeywords, ContextualKeywordColor, "The global contextual keyword, when it comes before the :: operator, refers to the global namespace, which is the default namespace for any C# program and is otherwise unnamed."));
            Keywords.Add("partial", new KeywordDescriptor(KeywordType.ContextualKeywords, ContextualKeywordColor, "Partial type definitions allow for the definition of a class, struct, interface or method to be split into multiple files or definitions."));
            Keywords.Add("remove", new KeywordDescriptor(KeywordType.ContextualKeywords, ContextualKeywordColor, "The remove contextual keyword is used to define a custom event accessor that is invoked when client code unsubscribes from your event."));
            Keywords.Add("set", new KeywordDescriptor(KeywordType.ContextualKeywords, ContextualKeywordColor, "The set keyword defines an accessor method in a property or indexer that assigns the value of the property or the indexer element."));
            Keywords.Add("where", new KeywordDescriptor(KeywordType.ContextualKeywords, ContextualKeywordColor, "In a generic type definition, the where clause is used to specify constraints on the types that can be used as arguments for a type parameter defined in a generic declaration."));
            Keywords.Add("value", new KeywordDescriptor(KeywordType.ContextualKeywords, ContextualKeywordColor, "The contextual keyword value is used in the set accessor in ordinary property declarations. It is similar to an input parameter on a method. "));
            Keywords.Add("yield", new KeywordDescriptor(KeywordType.ContextualKeywords, ContextualKeywordColor, "When you use the yield keyword in a statement, you indicate that the method, operator, or get accessor in which it appears is an iterator. "));

            // Query Keywords (LINQ)
            // Keywords.Add("", new KeywordDescriptor(KeywordType.QueryKeywords, QueryKeywordColor, ""));
            Keywords.Add("from", new KeywordDescriptor(KeywordType.QueryKeywords, QueryKeywordColor, "A query expression must begin with a from clause. Additionally, a query expression can contain sub-queries, which also begin with a from clause. "));
            Keywords.Add("select", new KeywordDescriptor(KeywordType.QueryKeywords, QueryKeywordColor, "In a query expression, the select clause specifies the type of values that will be produced when the query is executed."));
            Keywords.Add("group", new KeywordDescriptor(KeywordType.QueryKeywords, QueryKeywordColor, "The group clause returns a sequence of IGrouping<TKey,TElement> objects that contain zero or more items that match the key value for the group."));
            Keywords.Add("into", new KeywordDescriptor(KeywordType.QueryKeywords, QueryKeywordColor, "The into contextual keyword can be used to create a temporary identifier to store the results of a group, join or select clause into a new identifier."));
            Keywords.Add("orderby", new KeywordDescriptor(KeywordType.QueryKeywords, QueryKeywordColor, "In a query expression, the orderby clause causes the returned sequence or subsequence (group) to be sorted in either ascending or descending order."));
            Keywords.Add("join", new KeywordDescriptor(KeywordType.QueryKeywords, QueryKeywordColor, "The join clause is useful for associating elements from different source sequences that have no direct relationship in the object model."));
            Keywords.Add("let", new KeywordDescriptor(KeywordType.QueryKeywords, QueryKeywordColor, "In a query expression, it is sometimes useful to store the result of a sub-expression in order to use it in subsequent clauses. You can do this with the let keyword."));
            Keywords.Add("ascending", new KeywordDescriptor(KeywordType.QueryKeywords, QueryKeywordColor, "The ascending contextual keyword is used in the orderby clause in query expressions to specify that the sort order is from smallest to largest."));
            Keywords.Add("descending", new KeywordDescriptor(KeywordType.QueryKeywords, QueryKeywordColor, "The descending contextual keyword is used in the orderby clause in query expressions to specify that the sort order is from largest to smallest."));
            Keywords.Add("on", new KeywordDescriptor(KeywordType.QueryKeywords, QueryKeywordColor, "The on contextual keyword is used in the join clause of a query expression to specify the join condition."));
            Keywords.Add("equals", new KeywordDescriptor(KeywordType.QueryKeywords, QueryKeywordColor, "The equals contextual keyword is used in a join clause in a query expression to compare the elements of two sequences."));
            Keywords.Add("by", new KeywordDescriptor(KeywordType.QueryKeywords, QueryKeywordColor, "The by contextual keyword is used in the group clause in a query expression to specify how the returned items should be grouped."));

            // Preprocessor Directive
            // Keywords.Add("", new KeywordDescriptor(KeywordType.PreprocessorDirective, PreprocessorDirectiveColor, ""));
            Keywords.Add("#if", new KeywordDescriptor(KeywordType.PreprocessorDirective, PreprocessorDirectiveColor, "When the C# compiler encounters an #if directive, followed eventually by an #endif directive, it will compile the code between the directives only if the specified symbol is defined."));
            Keywords.Add("#else", new KeywordDescriptor(KeywordType.PreprocessorDirective, PreprocessorDirectiveColor, "#else lets you create a compound conditional directive, so that, if none of the expressions in the preceding #if or (optional) #elif directives to true, the compiler will evaluate all code between #else and the subsequent #endif."));
            Keywords.Add("#elif", new KeywordDescriptor(KeywordType.PreprocessorDirective, PreprocessorDirectiveColor, "#elif lets you create a compound conditional directive. The #elif expression will be evaluated if neither the preceding #if (C# Reference) nor any preceding, optional, #elif directive expressions evaluate to true."));
            Keywords.Add("#endif", new KeywordDescriptor(KeywordType.PreprocessorDirective, PreprocessorDirectiveColor, "#endif specifies the end of a conditional directive, which began with the #if directive."));
            Keywords.Add("#define", new KeywordDescriptor(KeywordType.PreprocessorDirective, PreprocessorDirectiveColor, "You use #define to define a symbol."));
            Keywords.Add("#undef", new KeywordDescriptor(KeywordType.PreprocessorDirective, PreprocessorDirectiveColor, "#undef lets you undefine a symbol, such that, by using the symbol as the expression in a #if directive, the expression will evaluate to false."));
            Keywords.Add("#warning", new KeywordDescriptor(KeywordType.PreprocessorDirective, PreprocessorDirectiveColor, "#warning lets you generate a level one warning from a specific location in your code."));
            Keywords.Add("#error", new KeywordDescriptor(KeywordType.PreprocessorDirective, PreprocessorDirectiveColor, "#error lets you generate an error from a specific location in your code."));
            Keywords.Add("#line", new KeywordDescriptor(KeywordType.PreprocessorDirective, PreprocessorDirectiveColor, "#line lets you modify the compiler's line number and (optionally) the file name output for errors and warnings. This example shows how to report two warnings associated with line numbers."));
            Keywords.Add("#region", new KeywordDescriptor(KeywordType.PreprocessorDirective, PreprocessorDirectiveColor, "#region lets you specify a block of code that you can expand or collapse when using the outlining feature."));
            Keywords.Add("#endregion", new KeywordDescriptor(KeywordType.PreprocessorDirective, PreprocessorDirectiveColor, "#endregion marks the end of a #region block."));
            Keywords.Add("#pragma", new KeywordDescriptor(KeywordType.PreprocessorDirective, PreprocessorDirectiveColor, "#pragma gives the compiler special instructions for the compilation of the file in which it appears."));

            // Define formats
            Formats.Add(new FormatDescriptor("//", CommentColor));
            Formats.Add(new FormatDescriptor("/*", "*/", CommentColor));
            Formats.Add(new FormatDescriptor("\"", "\"", StringLiteralColor));
            Formats.Add(new FormatDescriptor("'", "'", StringLiteralColor));

            // Define formatting commands
            FormattingCommands.Add(new LanguageFormatCommand("Comment", "//"));
            FormattingCommands.Add(new LanguageFormatCommand("Block Comment", "/*", "*/"));
            FormattingCommands.Add(new LanguageFormatCommand());

            var Directives = new LanguageFormatCommand("Preprocessor Directives");

            Directives.SubCommands.Add(new LanguageFormatCommand("If", "#if \n", "\n#endif\n"));
            Directives.SubCommands.Add(new LanguageFormatCommand("If..Else", "#if \n", "\n#else\n\n#endif\n"));
            Directives.SubCommands.Add(new LanguageFormatCommand("Define", "#define "));
            Directives.SubCommands.Add(new LanguageFormatCommand("Undefine", "#undef"));
            Directives.SubCommands.Add(new LanguageFormatCommand("Warning", "#warning"));
            Directives.SubCommands.Add(new LanguageFormatCommand("Error", "#error"));
            Directives.SubCommands.Add(new LanguageFormatCommand("Line", "#line"));
            Directives.SubCommands.Add(new LanguageFormatCommand("Region", "#region \n", "\n#endregion\n"));
            Directives.SubCommands.Add(new LanguageFormatCommand("Pragma", "#pragma"));
            FormattingCommands.Add(Directives);
        }
Example #39
0
 // Show constant or formula or array formula
 public abstract String Show(int col, int row, Formats fo);
Example #40
0
		public override String Show(int col, int row, Formats fo) { return "=" + e.Show(col, row, 0, fo); }
Example #41
0
        protected void Save()
        {
            using (var scope = new TransactionScope())
            {
                try
                {
                    if (listReceiptProducts.Count > 0)
                    {
                        double TongTien    = 0;
                        int    TongSoLuong = 0;
                        foreach (var prod in listReceiptProducts)
                        {
                            TongTien    += prod.ThanhTien;
                            TongSoLuong += prod.SoLuong;
                        }
                        string MaPhieu = null, strMaPhieu = "PX";
                        string MAX = (DBDataProvider.DB.ghPhieuGiaoHangs.Count() + 1).ToString();
                        for (int i = 1; i < (10 - MAX.Length); i++)
                        {
                            strMaPhieu += "0";
                        }
                        MaPhieu = strMaPhieu + MAX;
                        int             IDkhachHang = Int32.Parse(ccbNhaCungCap.Value.ToString());
                        var             KH          = DBDataProvider.DB.khKhachHangs.Where(x => x.IDKhachHang == IDkhachHang).FirstOrDefault();
                        ghPhieuGiaoHang giaohang    = new ghPhieuGiaoHang();
                        giaohang.NgayTao        = DateTime.Now;
                        giaohang.MaPhieu        = MaPhieu;
                        giaohang.NhanVienID     = Formats.IDUser();
                        giaohang.GhiChuGiaoHang = memoGhiChu.Text;
                        giaohang.KhachHangID    = IDkhachHang;
                        giaohang.NgayGiao       = Formats.ConvertToDateTime(dateNgayNhap.Text);
                        giaohang.NguoiGiao      = "";
                        giaohang.DiaChiGiaoHang = KH.DiaChi;
                        giaohang.DaXoa          = 0;
                        giaohang.TTThanhToan    = 0; //0 chưa thanh toán. 1 đã thanh toán
                        giaohang.TrangThai      = 0; // chưa duyệt, 1 đã duyệt
                        giaohang.TongSoLuong    = TongSoLuong;
                        giaohang.DienThoai      = KH.DienThoai;
                        giaohang.ChiNhanhID     = Formats.IDChiNhanh();
                        giaohang.TongTien       = TongTien;
                        giaohang.ThanhToan      = Convert.ToDouble(spKhachHangThoan.Number);
                        giaohang.GiamGia        = Convert.ToDouble(spGiamGia.Number);
                        giaohang.ConLai         = (TongTien - (Convert.ToDouble(spGiamGia.Number) + Convert.ToDouble(spKhachHangThoan.Number)));
                        giaohang.STTDonHang     = DBDataProvider.STTPhieuGiaoHang_DaiLy(IDkhachHang);

                        DBDataProvider.DB.ghPhieuGiaoHangs.InsertOnSubmit(giaohang);
                        DBDataProvider.DB.SubmitChanges();

                        int IDPhieuGiaoHang = Convert.ToInt32(giaohang.IDPhieuGiaoHang);
                        hiddenFields["IDPhieuMoi"] = IDPhieuGiaoHang;
                        foreach (var prod in listReceiptProducts)
                        {
                            // insert phiếu giao hàng chi tiết
                            ghPhieuGiaoHangChiTiet chitiet = new ghPhieuGiaoHangChiTiet();
                            chitiet.PhieuGiaoHangID = IDPhieuGiaoHang;
                            chitiet.HangHoaID       = prod.IDHangHoa;
                            chitiet.TonKho          = prod.TonKho;
                            chitiet.SoLuong         = prod.SoLuong;
                            chitiet.GiaBan          = prod.GiaBan;
                            chitiet.GiaVon          = prod.GiaVon;
                            chitiet.ThanhTien       = prod.ThanhTien;
                            DBDataProvider.DB.ghPhieuGiaoHangChiTiets.InsertOnSubmit(chitiet);
                            // trừ tạm tồn kho. không ghi công nợ, khi duyệt thì ghi thẻ kho + cộng công nợ khách hàng
                            var TonKhoBanDau = DBDataProvider.DB.hhHangHoas.Where(x => x.IDHangHoa == prod.IDHangHoa).FirstOrDefault();
                            if (TonKhoBanDau != null && TonKhoBanDau.LoaiHHID == 1)
                            {
                                TonKhoBanDau.hhTonKhos.Where(tk => tk.ChiNhanhID == Formats.IDChiNhanh()).FirstOrDefault().SoLuong -= prod.SoLuong;
                                // ghi thẻ kho
                                #region ghi thẻ kho
                                kTheKho thekho = new kTheKho();
                                thekho.NgayNhap    = DateTime.Now;
                                thekho.DienGiai    = "Lập phiếu giao hàng#" + MaPhieu;
                                thekho.Nhap        = 0;
                                thekho.Xuat        = prod.SoLuong;
                                thekho.GiaThoiDiem = prod.GiaBan;
                                thekho.Ton         = prod.TonKho - prod.SoLuong;
                                thekho.HangHoaID   = TonKhoBanDau.IDHangHoa;
                                thekho.ChiNhanhID  = Formats.IDChiNhanh();
                                thekho.NhanVienID  = Formats.IDUser();
                                DBDataProvider.DB.kTheKhos.InsertOnSubmit(thekho);
                                #endregion
                            }
                        }
                        DBDataProvider.DB.SubmitChanges();
                        scope.Complete();
                        cbpInfoImport.JSProperties["cp_Reset"] = true;
                    }
                    else
                    {
                        throw new Exception("Danh sách hàng hóa trống !!");
                        ccbBarcode.Text  = "";
                        ccbBarcode.Value = "";
                        ccbBarcode.Focus();
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
Example #42
0
 public void add(ImageFormat imgformat)
 {
     Formats format = new Formats();
     format.Format = imgformat;
     this.formats.Add(format);
 }
Example #43
0
        private void Import_Temp(DataTable datatable)
        {
            int intRow = datatable.Rows.Count;

            if (datatable.Columns.Contains("Mã hàng hóa") && datatable.Columns.Contains("Số lượng") && datatable.Columns.Contains("Giá bán"))
            {
                if (intRow != 0)
                {
                    for (int i = 0; i <= intRow - 1; i++)
                    {
                        DataRow dr     = datatable.Rows[i];
                        string  MaHang = dr["Mã hàng hóa"].ToString().Trim();
                        if (MaHang != "")
                        {
                            double GiaBan           = Convert.ToDouble(dr["Giá bán"] == null ? "0" : dr["Giá bán"].ToString().Trim());
                            int    SoLuong          = Convert.ToInt32(dr["Số lượng"] == null ? "0" : dr["Số lượng"].ToString().Trim());
                            int    tblHangHoa_Count = DBDataProvider.DB.hhHangHoas.Where(x => x.MaHang == MaHang && x.DaXoa == 0).Count();
                            if (tblHangHoa_Count > 0)
                            {
                                var tblHangHoa     = DBDataProvider.DB.hhHangHoas.Where(x => x.MaHang == MaHang && x.DaXoa == 0).FirstOrDefault();
                                var exitProdInList = listReceiptProducts.SingleOrDefault(r => r.MaHang == MaHang);
                                if (exitProdInList == null)
                                {
                                    oChiTietHoaDon cthd = new oChiTietHoaDon(
                                        tblHangHoa.IDHangHoa,
                                        tblHangHoa.MaHang,
                                        tblHangHoa.TenHangHoa,
                                        tblHangHoa.hhDonViTinh.TenDonViTinh,
                                        Convert.ToInt32(tblHangHoa.hhTonKhos.Where(s => s.ChiNhanhID == Convert.ToInt32(Formats.IDChiNhanh())).FirstOrDefault().SoLuong),
                                        SoLuong,
                                        GiaBan,
                                        Convert.ToDouble(tblHangHoa.GiaVon),
                                        SoLuong * GiaBan, 0, GiaBan
                                        );

                                    listReceiptProducts.Add(cthd);
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                throw new Exception("File excel không đúng. Vui lòng kiểm tra lại!!");
            }
        }
        protected void Save()
        {
            using (var scope = new TransactionScope())
            {
                try
                {
                    if (listReceiptProducts.Count > 0)
                    {
                        double TongTien    = 0;
                        int    TongSoLuong = 0;
                        foreach (var prod in listReceiptProducts)
                        {
                            TongTien    += prod.ThanhTien;
                            TongSoLuong += prod.SoLuong;
                        }

                        string MaPhieu = null, strMaPhieu = "PX";
                        string MAX = (DBDataProvider.DB.kPhieuXuatKhacs.Count() + 1).ToString();
                        for (int i = 1; i < (7 - MAX.Length); i++)
                        {
                            strMaPhieu += "0";
                        }
                        MaPhieu = strMaPhieu + MAX;


                        //Insert vào bảng phiếu xuất khác
                        kPhieuXuatKhac xuatkho = new kPhieuXuatKhac();
                        xuatkho.IDNhanVien  = Formats.IDUser();
                        xuatkho.MaPhieuXuat = MaPhieu;
                        xuatkho.NgayLap     = Formats.ConvertToDateTime(dateNgayNhap.Text);
                        xuatkho.GhiChu      = memoGhiChu.Text;
                        xuatkho.DaXoa       = 0;
                        xuatkho.NgayTao     = DateTime.Now;
                        xuatkho.TongTien    = TongTien;
                        xuatkho.SoLuong     = TongSoLuong;
                        DBDataProvider.DB.kPhieuXuatKhacs.InsertOnSubmit(xuatkho);
                        DBDataProvider.DB.SubmitChanges();

                        int IDXuat = xuatkho.IDPhieuXuat;

                        foreach (var prod in listReceiptProducts)
                        {
                            //Insert vào chi tiết xuất kho
                            kPhieuXuatKhacChiTiet detailXuatKho = new kPhieuXuatKhacChiTiet();
                            detailXuatKho.PhieuXuatID = IDXuat;
                            detailXuatKho.HangHoaID   = prod.IDHangHoa;
                            detailXuatKho.TonKho      = prod.TonKho;
                            detailXuatKho.SoLuong     = prod.SoLuong;
                            detailXuatKho.LyDoXuatID  = prod.LyDoXuatID;
                            detailXuatKho.GiaVon      = prod.GiaVon;
                            detailXuatKho.ThanhTien   = prod.ThanhTien;
                            DBDataProvider.DB.kPhieuXuatKhacChiTiets.InsertOnSubmit(detailXuatKho);

                            //Ghi thẻ kho || Trừ tồn kho
                            var TonKhoBanDau = DBDataProvider.DB.hhHangHoas.Where(x => x.IDHangHoa == prod.IDHangHoa).FirstOrDefault();
                            if (TonKhoBanDau != null)
                            {
                                TonKhoBanDau.TonKho -= prod.SoLuong;
                                #region ghi thẻ kho
                                kTheKho thekho = new kTheKho();
                                thekho.NgayNhap    = DateTime.Now;
                                thekho.DienGiai    = "Xuất khác #" + MaPhieu;
                                thekho.Nhap        = 0;
                                thekho.Xuat        = prod.SoLuong;
                                thekho.Ton         = prod.TonKho - prod.SoLuong;
                                thekho.GiaThoiDiem = 0;
                                thekho.HangHoaID   = TonKhoBanDau.IDHangHoa;
                                thekho.NhanVienID  = Formats.IDUser();
                                DBDataProvider.DB.kTheKhos.InsertOnSubmit(thekho);
                                #endregion
                            }
                        }
                        DBDataProvider.DB.SubmitChanges();
                        scope.Complete();
                        Reset();
                        cbpInfo.JSProperties["cp_Reset"] = true;
                    }
                    else
                    {
                        throw new Exception("Danh sách xuất kho trống !!");
                        ccbBarcode.Text  = "";
                        ccbBarcode.Value = "";
                        ccbBarcode.Focus();
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
Example #45
0
 public override String Show(int col, int row, int ctxpre, Formats fo)
 {
     return(error);
 }
Example #46
0
 public static void Alert(string s, Formats f = Formats.Default)
 {
     Log(s + " > ", f); Pathways.gameState = GameStates.Term;
 }
Example #47
0
		public override String Show(int col, int row, int ctxpre, Formats fo) { return "\"" + value + "\""; }
Example #48
0
		public override String Show(int col, int row, int ctxpre, Formats fo) { return "ValueConst[" + value + "]"; }