当前位置: 首页>>代码示例>>C#>>正文


C# TPhieuNhapxuatthuoc.Save方法代码示例

本文整理汇总了C#中TPhieuNhapxuatthuoc.Save方法的典型用法代码示例。如果您正苦于以下问题:C# TPhieuNhapxuatthuoc.Save方法的具体用法?C# TPhieuNhapxuatthuoc.Save怎么用?C# TPhieuNhapxuatthuoc.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TPhieuNhapxuatthuoc的用法示例。


在下文中一共展示了TPhieuNhapxuatthuoc.Save方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdatePhieuXuatKho

        /// <summary>
        /// hàm thực hiện việc cập nhập thông tin nhập kho thuốc
        /// </summary>
        /// <param name="objPhieuNhap"></param>
        /// <param name="arrPhieuNhapCts"></param>
        /// <returns></returns>
        public ActionResult UpdatePhieuXuatKho(TPhieuNhapxuatthuoc objPhieuNhap, TPhieuNhapxuatthuocChitiet[] arrPhieuNhapCts)
        {
            try
            {
                using (var Scope = new TransactionScope())
                {
                    using (var dbScope = new SharedDbConnectionScope())
                    {
                        objPhieuNhap.NgaySua =  globalVariables.SysDate;
                        objPhieuNhap.NguoiSua = globalVariables.UserName;
                        objPhieuNhap.TongTien = arrPhieuNhapCts.Sum(c => c.ThanhTien);
                        objPhieuNhap.Save();

                        new Delete().From(TPhieuNhapxuatthuocChitiet.Schema)
                            .Where(TPhieuNhapxuatthuocChitiet.Columns.IdPhieu).IsEqualTo(objPhieuNhap.IdPhieu).Execute();
                        foreach (TPhieuNhapxuatthuocChitiet objPhieuNhapCt in arrPhieuNhapCts)
                        {
                            objPhieuNhapCt.IdPhieu= Utility.Int32Dbnull(objPhieuNhap.IdPhieu, -1);
                            objPhieuNhapCt.IsNew = true;
                            objPhieuNhapCt.Save();
                        }
                    }
                    Scope.Complete();
                    return ActionResult.Success;
                }
            }
            catch (Exception exception)
            {
                log.Error("Loi trong qua trinh sua phieu nhap kho :{0}", exception);
                return ActionResult.Error;

            }
        }
开发者ID:vmshis2015,项目名称:VMSPharmacy,代码行数:39,代码来源:XuatThuocAo.cs

示例2: Insert

        public void Insert(string MaPhieu,string SoHoadon,DateTime NgayHoadon,short? IdKhonhap,short? IdKhoxuat,decimal? Vat,string MaNhacungcap,string MotaThem,string NguoiGiao,string NguoiNhan,string NguoiHuy,short? IdNhanvien,byte? SttHthi,byte? TrangThai,DateTime? NgayTao,string NguoiTao,string NguoiSua,DateTime? NgaySua,decimal? TongTien,byte? LoaiPhieu,string TenLoaiphieu,short? IdNhanvienXacnhan,string NguoiXacnhan,DateTime? NgayXacnhan,short? IdKhoalinh,string KieuThuocvattu,string SoChungtuKemtheo,byte? PhieuVay,string TkNo,string TkCo,byte? DuTru,byte? NoiTru,string HoidongThanhly,string DiadiemThanhly,string YkienDexuat,DateTime? ThoigianThanhlyTu,DateTime? ThoigianThanhlyDen)
        {
            TPhieuNhapxuatthuoc item = new TPhieuNhapxuatthuoc();

            item.MaPhieu = MaPhieu;

            item.SoHoadon = SoHoadon;

            item.NgayHoadon = NgayHoadon;

            item.IdKhonhap = IdKhonhap;

            item.IdKhoxuat = IdKhoxuat;

            item.Vat = Vat;

            item.MaNhacungcap = MaNhacungcap;

            item.MotaThem = MotaThem;

            item.NguoiGiao = NguoiGiao;

            item.NguoiNhan = NguoiNhan;

            item.NguoiHuy = NguoiHuy;

            item.IdNhanvien = IdNhanvien;

            item.SttHthi = SttHthi;

            item.TrangThai = TrangThai;

            item.NgayTao = NgayTao;

            item.NguoiTao = NguoiTao;

            item.NguoiSua = NguoiSua;

            item.NgaySua = NgaySua;

            item.TongTien = TongTien;

            item.LoaiPhieu = LoaiPhieu;

            item.TenLoaiphieu = TenLoaiphieu;

            item.IdNhanvienXacnhan = IdNhanvienXacnhan;

            item.NguoiXacnhan = NguoiXacnhan;

            item.NgayXacnhan = NgayXacnhan;

            item.IdKhoalinh = IdKhoalinh;

            item.KieuThuocvattu = KieuThuocvattu;

            item.SoChungtuKemtheo = SoChungtuKemtheo;

            item.PhieuVay = PhieuVay;

            item.TkNo = TkNo;

            item.TkCo = TkCo;

            item.DuTru = DuTru;

            item.NoiTru = NoiTru;

            item.HoidongThanhly = HoidongThanhly;

            item.DiadiemThanhly = DiadiemThanhly;

            item.YkienDexuat = YkienDexuat;

            item.ThoigianThanhlyTu = ThoigianThanhlyTu;

            item.ThoigianThanhlyDen = ThoigianThanhlyDen;

            item.Save(UserName);
        }
开发者ID:vmshis2015,项目名称:VMSPharmacy,代码行数:80,代码来源:TPhieuNhapxuatthuocController.cs

示例3: ThemPhieuXuatKho

        /// <summary>
        /// hàm thực hiện việc thêm phiếu nhập kho thuốc
        /// </summary>
        /// <param name="objPhieuNhap"></param>
        /// <param name="arrPhieuNhapCts"></param>
        /// <returns></returns>
        public ActionResult ThemPhieuXuatKho(TPhieuNhapxuatthuoc objPhieuNhap, TPhieuNhapxuatthuocChitiet[] arrPhieuNhapCts)
        {
            try
            {
                using (var Scope = new TransactionScope())
                {
                    using (var dbScope = new SharedDbConnectionScope())
                    {
                        objPhieuNhap.NgayTao = globalVariables.SysDate;
                        objPhieuNhap.NguoiTao = globalVariables.UserName;
                        objPhieuNhap.MaPhieu = Utility.sDbnull(THU_VIEN_CHUNG.MaNhapKho(Utility.Int32Dbnull(objPhieuNhap.LoaiPhieu)));
                        objPhieuNhap.TongTien = arrPhieuNhapCts.Sum(c => c.ThanhTien);
                        objPhieuNhap.IsNew = true;
                        objPhieuNhap.Save();

                        objPhieuNhap = TPhieuNhapxuatthuoc.FetchByID(objPhieuNhap.IdPhieu);
                        if (objPhieuNhap != null)
                        {
                            foreach (TPhieuNhapxuatthuocChitiet objPhieuNhapCt in arrPhieuNhapCts)
                            {
                                objPhieuNhapCt.IdPhieu = Utility.Int32Dbnull(objPhieuNhap.IdPhieu, -1);
                                objPhieuNhapCt.IsNew = true;
                                objPhieuNhapCt.Save();
                            }
                        }
                    }
                    Scope.Complete();
                    return ActionResult.Success;
                }
            }
            catch (Exception exception)
            {
                log.Error("Loi trong qua trinh them :{0}", exception);
                return ActionResult.Error;

            }
        }
开发者ID:vmshis2015,项目名称:VMSPharmacy,代码行数:43,代码来源:XuatThuocAo.cs

示例4: ThemPhieuNhapKho

        /// <summary>
        /// hàm thực hiện việc thêm phiếu nhập kho thuốc
        /// </summary>
        /// <param name="objPhieuNhap"></param>
        /// <param name="arrPhieuNhapCts"></param>
        /// <returns></returns>
        public ActionResult ThemPhieuNhapKho(TPhieuNhapxuatthuoc objPhieuNhap, List<TPhieuNhapxuatthuocChitiet> arrPhieuNhapCts)
        {
            try
            {
                using (var Scope = new TransactionScope())
                {
                    using (var dbScope = new SharedDbConnectionScope())
                    {
                        objPhieuNhap.NgayTao = globalVariables.SysDate;
                        objPhieuNhap.NguoiTao = globalVariables.UserName;
                        objPhieuNhap.MaPhieu = Utility.sDbnull(THU_VIEN_CHUNG.MaNhapKho(Utility.Int32Dbnull(objPhieuNhap.LoaiPhieu)));
                        objPhieuNhap.TongTien = arrPhieuNhapCts.Sum(c => c.ThanhTien);
                        objPhieuNhap.IsNew = true;
                        objPhieuNhap.Save();

                        //StoredProcedure sp = SPs.ThuocPhieunhapThemmoi(objPhieuNhap.IdPhieu,
                        //                                          Utility.sDbnull(objPhieuNhap.MaPhieu),
                        //                                          Utility.sDbnull(objPhieuNhap.SoHoaDon),
                        //                                          objPhieuNhap.NgayNhapHdon, objPhieuNhap.IdKhonhap,
                        //                                          objPhieuNhap.IdKhoxuat, objPhieuNhap.Vat,
                        //                                          objPhieuNhap.IdNhaCcap, objPhieuNhap.GhiChu,
                        //                                          objPhieuNhap.NguoiGiao, objPhieuNhap.IdNhanvien,
                        //                                          objPhieuNhap.HienThi, objPhieuNhap.TrangThai,
                        //                                          objPhieuNhap.Ngaytao, objPhieuNhap.NguoiTao,
                        //                                          objPhieuNhap.NguoiSua, objPhieuNhap.NgaySua,
                        //                                          objPhieuNhap.IpMayTao, objPhieuNhap.IpMaySua,
                        //                                          objPhieuNhap.TongTien, objPhieuNhap.LoaiPhieu,
                        //                                          objPhieuNhap.MaKieuPhieu, objPhieuNhap.IdNvienXacNhan, objPhieuNhap.NguoiXacnhan, objPhieuNhap.NgayXacnhan, objPhieuNhap.IdKhoaLinh);
                        //sp.Execute();
                        //objPhieuNhap.IdPhieu = Utility.Int32Dbnull(sp.OutputValues[0]);
                        //objPhieuNhap = TPhieuNhapxuatthuoc.FetchByID(objPhieuNhap.IdPhieu);
                        if (objPhieuNhap != null)
                        {
                            foreach (TPhieuNhapxuatthuocChitiet objPhieuNhapCt in arrPhieuNhapCts)
                            {
                                objPhieuNhapCt.IdPhieu = Utility.Int32Dbnull(objPhieuNhap.IdPhieu, -1);
                                objPhieuNhapCt.IsNew = true;
                                objPhieuNhapCt.Save();
                            }
                        }

                    }
                    Scope.Complete();
                    return ActionResult.Success;
                }
            }
            catch (Exception exception)
            {
                log.Error("Loi trong qua trinh them phieu nhap kho :{0}", exception);
                return ActionResult.Error;

            }
        }
开发者ID:vmshis2015,项目名称:VMSPharmacy,代码行数:59,代码来源:THUOC_NHAPKHO.cs


注:本文中的TPhieuNhapxuatthuoc.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。