public RBTaoPhieuXuatKhoToPYCGC(long PHIEU_ID, PhieuType loaiPhieuNguon, PhieuType loaiPhieuDich,long Kho_ID)
 {
     this.PHIEU_ID = PHIEU_ID;
     this.loaiPhieuNguon = loaiPhieuNguon;
     this.loaiPhieuDich = loaiPhieuDich;
     this.Kho_ID=Kho_ID;
 }
Esempio n. 2
0
        //Còn vấn đề phân quyền
        public static List<Object> InitNghiepVu(ContextMenuStrip mnuNghiepVu, PhieuType PhieuFrom, object DOData)
        {
            List<Object> list = new List<Object>();

            List<PhieuType> Phieus = PhieuFrom.CanCreateList;
            ToolStripMenuItem[] Items = new ToolStripMenuItem[Phieus.Count];
            for (int i = 0; i < Phieus.Count; i++)
            {
                PhieuType PhieuTo = Phieus[i];
                ToolStripMenuItem item = new ToolStripMenuItem();
                item.Name = PhieuTo.GetDOName();
                //this.item.Size = new System.Drawing.Size(286, 22);
                item.Text = "Tạo " + PhieuTo.GetTitle();
                item.Click += delegate(object sender, EventArgs e)
                {
                    ProtocolForm.ShowModalForm((XtraForm)mnuNghiepVu.FindForm(), PhieuTo.GetFormClassName(), DOData);
                };
                Items[i] = item;
                ApplyPermissionAction.ApplyPermissionObject(list, Items[i], PhieuTo.AllowAdd);
                //list.Add(PhieuTo.AllowAdd);
            }

            if (Items.Length == 0)
                mnuNghiepVu.Visible = false;
            else
                mnuNghiepVu.Items.AddRange(Items);

            return list;
        }
Esempio n. 3
0
 public static bool Check(RangBuocSoLgTrLgExt rule, PhieuType Src, long SrcID, 
     PhieuType Des, long DesID, Object DesObj, PLGridView DesGrid)
 {
     //Lay danh sach cac phieu thuoc nhom phieu des duoc tao tu (Src, SrcID)
     //Duoc xay dung tu PhieuLienQuan List (TYPE_ID, ID)
     List<object[]> LObj = DAPhieuLienQuan.GetListPhieuLienQuan(SrcID, Src, Des);
     return rule.Check(Src, SrcID, LObj, Des, DesID, DesObj, DesGrid);
 }
 public RangBuocDeletePhieuTonKho(DataSet DetailDataSet,
     PhieuType Des, long Kho_Id, DateTime? Ngay_Nhap)
 {
     this.DetailDataTable = DetailDataSet.Tables[0];
     this.Des = Des;
     this.Ngay_phat_sinh = Ngay_Nhap;
     this.Kho_Id = Kho_Id;
 }
 public static bool KiemTraTaoPhieu(long ID_PhieuNguon, PhieuType LoaiPhieu)
 {
     DataSet ds = Get_SoLuongConLai(ID_PhieuNguon, LoaiPhieu);
     // Neu phieu nguon chua tao het phieu lien quan thi co the tao duoc phieu dich
     if (ds != null && ds.Tables[0].Rows.Count > 0)
         return true;
     else
         return false ;
 }
Esempio n. 6
0
 public RangBuocSoLgTrLgExt(PhieuType Src, long SrcID, PhieuType Des, long DesID, 
     object DesObj, PLGridView DesGrid)
 {
     this.Src = Src;
     this.SrcID = SrcID;
     this.Des = Des;
     this.DesID = DesID;
     this.DesObj = DesObj;
     this.DesGrid = DesGrid;
 }
 public static DataTable ViPhamRangBuoc(long ID_PhieuNguon, PhieuType LoaiPhieuNguon,object DOPhieuDich, PhieuType LoaiPhieuDich)
 {
     DataSet dsNguon = Get_SoLuongConLai(ID_PhieuNguon, LoaiPhieuNguon);
     DataSet dsDich = new DataSet();
     DataTable dtViPham = new DataTable();
     dtViPham.Columns.Add("HH_ID", Type.GetType("Int64"));
     dtViPham.Columns.Add("VI_PHAM");
     if (LoaiPhieuDich.GetTypeID() == 1)
     {
     }
     return new DataTable();
 }
Esempio n. 8
0
 //PhieuTypeID, TieuDePhieu
 public static DataSet GetPhieuLienQuan(PhieuType Phieu)
 {
     DatabaseFB db = DABase.getDatabase();
     DataSet ds = new DataSet();
     DbCommand cmd = db.GetStoredProcCommand("FW_ST_NGHIEP_VU");
     db.AddInParameter(cmd, "@TABLE_NAME", DbType.String, Phieu.GetTableName());
     db.LoadDataSet(cmd, ds, "NGHIEP_VU");
     if (ds.Tables[0].Rows.Count != 0)
         return ds;
     else
         return null;
 }
Esempio n. 9
0
 public DataTable GetConLai(PhieuType Des)
 {
     foreach (DataRow dr in ConLai.Rows)
     {
         if (HelpNumber.ParseDecimal(dr["SO_LUONG"]) <= 0 ||
             HelpNumber.ParseDecimal(dr["TRONG_LUONG"]) <= 0)
         {
             dr.Delete();
         }
     }
     if(RangBuocSoLgTrLgHelp.CheckColumnsExist(ConLai, "TINH_TRANG"))
         ConLai.Columns["TINH_TRANG"].ColumnName = Des.GetSTTField();
     return ConLai;
 }
Esempio n. 10
0
 /// <summary>
 /// Tạo DataTable(HH_ID, SO_LUONG, TRONG_LUONG) lưu trữ hàng hóa, kèm số lượng, trọng lượng
 /// Thuộc 1 phiếu bất kì có loại phiếu và ID
 /// </summary>
 /// <param name="type">Loại phiếu</param>
 /// <param name="id">ID</param>
 /// <returns></returns>
 public static DataTable CreateSoTien(PhieuType type, long id)
 {
     try
     {
         string sql = "select Tong_tien  as \"SO_TIEN\" from "
             + type.GetTableName() + " where 1=1";
         QueryBuilder filter = new QueryBuilder(sql);
         filter.addID(type.GetIDField(), id);
         DataSet ds = DABase.getDatabase().LoadDataSet(filter);
         return ds.Tables[0];
     }
     catch (Exception ex)
     {
         PLException.AddException(ex);
         return null;
     }
 }
Esempio n. 11
0
 public static void PrintPhieu(XtraForm mainForm, PrintType CachIn, PhieuType LoaiPhieu, long[] IDs, GetPrintObj Print)
 {
     try
     {
         _Print _print = Print(mainForm, LoaiPhieu, IDs);
         _print.MainForm = mainForm;
         if (_print != null)
         {
             if (CachIn == PrintType.PREVIEW)
                 HelpReport.Preview(_print);
             else if (CachIn == PrintType.DIRECT)
                 HelpReport.Print(_print);
         }
     }
     catch
     { }
 }
Esempio n. 12
0
        public static DataTable ViPhamRangBuoc(long ID_PhieuNguon, PhieuType LoaiPhieuNguon,PLGridView gridDich)
        {
            DataSet dsNguon = Get_SoLuongConLai(ID_PhieuNguon, LoaiPhieuNguon);
            DataTable dtViPham = new DataTable();
            dtViPham.Columns.Add("HH_ID", Type.GetType("Int64"));
            dtViPham.Columns.Add("VI_PHAM");

            if (dsNguon == null || dsNguon.Tables[0].Rows.Count == 0)
                return dtViPham;

            for (int i = 0; i < gridDich.RowCount; i++)
            {
                DataRow rowDich = gridDich.GetDataRow(i);
                DataRow rowViPham = dtViPham.NewRow();
                bool exists = false;
                for (int k = 0; k < dsNguon.Tables[0].Rows.Count; k++)
                {
                    DataRow rowNguon = dsNguon.Tables[0].Rows[k];
                    if (HelpNumber.ParseInt64(rowDich["HH_ID"]) == HelpNumber.ParseInt64(rowNguon["HH_ID"]))
                    {
                        // HH_ID co ton tai trong phieu nguon
                        exists = true;
                        if (HelpNumber.ParseDecimal(rowDich["SO_LUONG"]) > HelpNumber.ParseDecimal(rowNguon["SO_LUONG"]))
                        {
                            rowViPham["HH_ID"] = rowDich["HH_ID"];
                            rowViPham["VI_PHAM"] = "Vi phạm về ràng buộc số lượng";
                            dtViPham.Rows.Add(rowViPham);
                        }
                    }
                }
                if (!exists)
                {
                    rowViPham["HH_ID"] = rowDich["HH_ID"];
                    rowViPham["VI_PHAM"] = "Mã hàng này không có trong phiếu nguồn";
                    dtViPham.Rows.Add(rowViPham);
                }
            }
            return dtViPham;
        }
Esempio n. 13
0
 public static _MenuItem GetBusinessMenuList(XtraForm FormQL, PhieuType Phieu, DelegationLib.CallFunction_MulIn_SinOut DOData)
 {
     List<PhieuType> Phieus = Phieu.CanCreateList;
     DelegationLib.CallFunction_MulIn_NoOut[] Actions = new DelegationLib.CallFunction_MulIn_NoOut[Phieus.Count];
     string[] Titles = new string[Phieus.Count];
     string[] ImageNames = new string[Phieus.Count];
     PermissionItem[] Permissions = new PermissionItem[Phieus.Count];
     for (int i = 0; i < Phieus.Count; i++)
     {
         PhieuType PhieuTo = Phieus[i];
         Titles[i] = "Tạo " + PhieuTo.GetTitle();
         ImageNames[i] = PhieuTo.GetImageName();
         Permissions[i] = PhieuTo.AllowAdd;
         Actions[i] = delegate(List<object> ids)
         {
             if (ids != null && ids.Count > 0)
             {
                 ProtocolForm.ShowModalForm(FormQL, PhieuTo.GetFormClassName(), DOData(ids));
             }
         };
     }
     return new _MenuItem(Titles, ImageNames, Phieu.GetIDField(), Actions, Permissions);
 }
Esempio n. 14
0
 public RangBuocTonKho(PLGridView DesGrid, DataSet DetailDataSet, 
     DataSet GridDataSetSrc, PhieuType Des, long Kho_Id, bool? IsAdd)
 {
     this.DesGrid = DesGrid;
     if (DetailDataSet != null && DetailDataSet.Tables.Count > 0)
     {
         if (IsAdd == true)
             this.DetailDataTable = DetailDataSet.Tables[0];
         else
         {
             foreach (DataRow rowLast in DetailDataSet.Tables[0].Rows)
             {
                 foreach (DataRow rowFirst in GridDataSetSrc.Tables[0].Rows)
                 {
                     if (rowLast.RowState != DataRowState.Deleted)
                     {
                         if ((HelpNumber.ParseInt64(rowLast["HH_ID"]) ==
                             HelpNumber.ParseInt64(rowFirst["HH_ID"]))
                             && (HelpNumber.ParseInt64(rowLast[Des.GetSTTField()]) ==
                             HelpNumber.ParseInt64(rowFirst[Des.GetSTTField()])))
                         {
                             rowLast[Des.GetSOLGField()] =
                                 HelpNumber.ParseDecimal(rowLast[Des.GetSOLGField()]) -
                                 HelpNumber.ParseDecimal(rowFirst[Des.GetSOLGField()]);
                             rowLast[Des.GetTRLGField()] =
                                 HelpNumber.ParseDecimal(rowLast[Des.GetTRLGField()]) -
                                 HelpNumber.ParseDecimal(rowFirst[Des.GetTRLGField()]);
                         }
                     }
                 }
             }
             this.DetailDataTable = DetailDataSet.Tables[0];
         }
     }
     this.Des = Des;
     this.Kho_Id = Kho_Id;
 }
Esempio n. 15
0
        //Trả về số lượng, trọng lượng còn lại có thể chấp nhận
        private bool Check(PhieuType Src, long SrcID, List<object[]> LObj, PhieuType Des, 
            long DesID, object DesObj, PLGridView DesGrid)
        {
            ISoLgTrLg data = (ISoLgTrLg)DesObj;
            //Tạo DataTable(HH_ID, SO_LUONG, TRONG_LUONG, TINH_TRANG)
            DataTable dt_lienquan = RangBuocSoLgTrLgExtHelp.CreateDTHangHoa(LObj, DesID);

            DataTable dt_sum = new DataTable();
            dt_sum = RangBuocSoLgTrLgExtHelp.GetData_Standard(Src, SrcID).Tables[0];

            //Lấy HH_ID, SO_LUONG, TRONG_LUONG, TINH_TRANG cua DesObj nếu tồn tại
            if (data != null)
            {
                DataTable dt_des = data.GetSoLgTrLg().Copy();
                if (RangBuocSoLgTrLgExtHelp.DieuChinhTenCot(dt_des, Des))
                {
                    //Merge thêm vào dt_lienquan từ dt_des
                    RangBuocSoLgTrLgExtHelp.MergeAddHangHoaExt(ref dt_lienquan, dt_des);
                }
            }
            //Kiểm tra ràng buộc về số lượng và trọng lượng
            //Kết quả trả về DataTable miêu tả các dòng vi phạm
            DataTable dt_vipham = RangBuocSoLgTrLgExtHelp.KiemTraRangBuocExt(dt_sum, dt_lienquan);
            if (dt_vipham.Rows.Count != 0 && DesGrid != null)
                RangBuocSoLgTrLgExtHelp.ShowErrorOnGridExt(DesGrid, dt_vipham, Des);

            //Merge giảm vào dt_sum từ dt_lienquan
            RangBuocSoLgTrLgExtHelp.MergeMinusHangHoaExt(ref dt_sum, dt_lienquan);
            //Set số lượng còn lại
            ConLai = dt_sum;

            //Nếu dt_vipham không tồn tại dòng vi phạm và phiếu nguồn chưa tạo hết phiếu liên quan
            bool flag = false;
            if (data != null)
            {
                if (dt_vipham.Rows.Count == 0)
                    flag = true;
            }
            else
            {
                if (RangBuocSoLgTrLgHelp.KiemTraTaoPhieu(ConLai))
                    flag = true;
            }
            return flag;
        }
Esempio n. 16
0
 private static DataSet Get_SoLuongConLai(long ID_PhieuNguon, PhieuType LoaiPhieuNguon)
 {
     //Lấy về số lượng còn lại từ store FW_TINH_SO_LUONG_CON
     string str = "select * from FW_TINH_SO_LUONG_CON("+ID_PhieuNguon + ","+LoaiPhieuNguon.GetTypeID()+")";
     try
     {
         return DABase.getDatabase().LoadDataSet(str);
     }
     catch { return new DataSet(); }
 }
Esempio n. 17
0
 /// <summary>
 /// Thể hiện lỗi trên Grid dựa vào DataTable chứa các dòng lỗi        
 /// </summary>
 /// <param name="gridDich">Grid cần thể hiện lỗi</param>
 /// <param name="dt_error">DataTable các dòng lỗi</param>
 public static void ShowErrorOnGridExt(PLGridView gridDich, DataTable dt_error, PhieuType Des)
 {
     RangBuocSoLgTrLgHelp.AddFormatCond(gridDich);
     for (int i = 0; i < gridDich.RowCount; i++)
     {
         gridDich.SetRowCellValue(i, gridDich.Columns["CHECK"], 1);
         gridDich.SetRowCellValue(i, gridDich.Columns["VI_PHAM"], "");
         foreach (DataRow dr_error in dt_error.Rows)
         {
             DataRow rowDich = gridDich.GetDataRow(i);
             if ((HelpNumber.ParseInt64(rowDich["HH_ID"]) == HelpNumber.ParseInt64(dr_error["HH_ID"]))
                 && (HelpNumber.ParseInt64(rowDich[Des.GetSTTField()]) == HelpNumber.ParseInt64(dr_error["TINH_TRANG"])))
             {
                 gridDich.SetRowCellValue(i, gridDich.Columns["CHECK"], 0);
                 gridDich.SetRowCellValue(i, gridDich.Columns["VI_PHAM"], dr_error["VI_PHAM"]);
                 gridDich.UpdateCurrentRow();
                 gridDich.OptionsView.ShowPreview = true;
                 gridDich.OptionsView.AutoCalcPreviewLineCount = true;
                 gridDich.PreviewFieldName = "VI_PHAM";
                 gridDich.CustomDrawRowPreview +=
                     new DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventHandler(
                         RangBuocSoLgTrLgHelp.gridDich_CustomDrawRowPreview);
             }
         }
     }
 }
Esempio n. 18
0
 public DataSet ListDesMoney(PhieuType Src, long id)
 {
     //            string str = @"select thu.pt_id id_phieu,
     //                                 (select id from dm_phieu where table_name='PHIEU_THU') loai_phieu,
     //                                  thu.so_tien  from phieu_thu_ct thu
     //                           where thu.object_id=1003294
     //                           union
     //                           select kh.pkht_id,
     //                                 (select id from dm_phieu where table_name='PHIEU_KE_HOACH_THU') loai_phieu,
     //                                  kh.tien_phai_thu so_tien from phieu_ke_hoach_thu_ct kh
     //                           where kh.pbh_id=1003294;";
     return new DataSet();
 }
 public bool Check(PhieuType Src, long SrcID, List<object[]> LObj, PhieuType Des, long DesID, object DesObj, DevExpress.XtraGrid.Views.Grid.PLGridView DesGrid)
 {
     return false;
 }
Esempio n. 20
0
        public static bool Add(PhieuType type)
        {
            foreach (PhieuType phieu in Store)
            {
                if (phieu.ID == type.ID)
                    throw new Exception("Trùng phiếu");
            }

            Store.Add(type);
            return true;
        }
Esempio n. 21
0
 public bool CanCreatePhieu(PhieuType Phieu)
 {
     return CanCreateList.Contains(Phieu);
 }
 // Kiểm tra 1 phiếu chỉ tạo ra một phiếu
 public RB1PhieuNguon2OrPhieuDich(long phieuNguon_ID, PhieuType loaiPhieuCanTao)
 {
     this.PHIEU_ID = phieuNguon_ID;
     this.loaiPhieuCanKiemTra = loaiPhieuCanTao;
     this.loaiPhieuCanTao = loaiPhieuCanTao;
 }
Esempio n. 23
0
        private bool Check(PhieuType Src, long SrcID, List<object[]> LObj, PhieuType Des,
            long DesID, object DesObj, PLGridView DesGrid)
        {
            ISoTien data = (ISoTien)DesObj;
            DataTable dt_lienquan = RangBuocThanhTienHelp.CreateSoTien(LObj,SrcID, DesID);
            DataTable dt_sum = RangBuocThanhTienHelp.CreateSoTien(Src, SrcID);

            if (data != null)
            {
                if (dt_lienquan.Rows.Count == 0)
                {
                    dt_lienquan.Rows.Add(dt_lienquan.NewRow());
                    dt_lienquan.Rows[0]["SO_TIEN"] = 0;
                }
                dt_lienquan.Rows[0]["SO_TIEN"] = data.GetSoTienThu()+
                    HelpNumber.ParseDecimal(dt_lienquan.Rows[0]["SO_TIEN"]);
            }
            bool chapnhan = RangBuocThanhTienHelp.KiemTraRangBuoc(dt_sum, dt_lienquan);
            ConLai=dt_sum.Clone();
            if(data!=null)
            {
                if (!chapnhan)
                {  decimal tong_tien=HelpNumber.ParseDecimal(dt_sum.Rows[0][0]);
                   decimal so_tien_lienquan=HelpNumber.ParseDecimal(dt_lienquan.Rows[0][0]);
                   string vi_pham="Vi phạm ràng buộc về Số tiền. Số tiền cho phép: <=" +
                                    (tong_tien - (so_tien_lienquan-data.GetSoTienThu())) + " !";
                   RangBuocThanhTienHelp.ShowErrorOnGrid( DesGrid,vi_pham);
                   return false;
                }
            }
            else
            {
                 if (chapnhan)
                 {
                    if (dt_lienquan == null || dt_lienquan.Rows.Count == 0)
                        ConLai = dt_sum;
                    else
                    {
                        dt_sum.Rows[0]["SO_TIEN"] = HelpNumber.ParseDecimal(dt_sum.Rows[0]["SO_TIEN"]) -
                                                  HelpNumber.ParseDecimal(dt_lienquan.Rows[0]["SO_TIEN"]);
                        ConLai = dt_sum;
                    }
                    if (HelpNumber.ParseDecimal(ConLai.Rows[0][0]) == 0)
                        return false;
                 }
                 else return false;
            }
            return true;
        }
Esempio n. 24
0
        /// <summary>
        /// Cập nhật lại tên cột tình trạng cho phù hợp với mục đích sử dụng 
        /// </summary>
        /// <param name="table">DataTable cần cập nhật lại tên cột tình trạng</param>
        /// <param name="Des">Loại phiếu đích</param>
        /// <returns></returns>
        public static bool DieuChinhTenCot(DataTable table, PhieuType Des)
        {
            if (!RangBuocSoLgTrLgHelp.CheckColumnsExist(table, Des.GetSTTField(),
                Des.GetSOLGField(), Des.GetTRLGField()))
            {
                return false;
            }

            foreach (DataColumn dc in table.Columns)
            {
                if (dc.ColumnName == Des.GetSTTField())
                    dc.ColumnName = "TINH_TRANG";
                else if (dc.ColumnName == Des.GetSOLGField())
                    dc.ColumnName = "SO_LUONG";
                else if (dc.ColumnName == Des.GetTRLGField())
                    dc.ColumnName = "TRONG_LUONG";
            }
            return true;
        }
Esempio n. 25
0
 /// <summary>
 /// Tạo DataTable(HH_ID, SO_LUONG, TRONG_LUONG, TINH_TRANG) lưu trữ hàng hóa, 
 /// số lượng, trọng lượng và tình trạng
 /// Thuộc 1 phiếu bất kì có loại phiếu và ID
 /// </summary>
 /// <param name="type">Loại phiếu</param>
 /// <param name="id">ID</param>
 /// <returns>DataSet chứa DataTable(HH_ID, SO_LUONG, TRONG_LUONG, TINH_TRANG)</returns>
 public static DataSet GetData_Standard(PhieuType type, long id)
 {
     try
     {
         QueryBuilder filter = new QueryBuilder("select hh_id as \"HH_ID\","
             + type.GetSOLGField() + " as \"SO_LUONG\","
             + type.GetTRLGField() + " as \"TRONG_LUONG\","
             + type.GetSTTField() + " as \"TINH_TRANG\" from "
             + type.GetTableName() + "_CT" + " where 1=1");
         filter.addID(type.GetIDField(), id);
         return DABase.getDatabase().LoadDataSet(filter);
     }
     catch (Exception ex)
     {
         PLException.AddException(ex);
         return null;
     }
 }
        public RangBuocDeletePhieuTonKho(DataSet DetailDataSet,
            DataSet GridDataSetSrc, PhieuType Des, long Kho_Id, DateTime? Ngay_Nhap)
        {
            if (DetailDataSet != null && DetailDataSet.Tables.Count > 0)
            {
                foreach (DataRow rowLast in DetailDataSet.Tables[0].Rows)
                {
                    if (rowLast.RowState != DataRowState.Deleted)
                    {
                        foreach (DataRow rowFirst in GridDataSetSrc.Tables[0].Rows)
                        {
                            if (rowLast.RowState == DataRowState.Added)
                            {
                                rowLast[Des.GetSOLGField()] = 0;
                                rowLast[Des.GetTRLGField()] = 0;
                            }
                            else
                            {
                                if ((HelpNumber.ParseInt64(rowLast["HH_ID"]) ==
                                    HelpNumber.ParseInt64(rowFirst["HH_ID"]))
                                    && (HelpNumber.ParseInt64(rowLast[Des.GetSTTField()]) ==
                                    HelpNumber.ParseInt64(rowFirst[Des.GetSTTField()])))
                                {
                                    rowLast[Des.GetSOLGField()] =
                                        HelpNumber.ParseDecimal(rowLast[Des.GetSOLGField()]) -
                                        HelpNumber.ParseDecimal(rowFirst[Des.GetSOLGField()]);
                                    if (HelpNumber.ParseDecimal(rowLast[Des.GetSOLGField()]) > 0)
                                        rowLast[Des.GetSOLGField()] = 0;
                                    else
                                    {
                                        rowLast[Des.GetSOLGField()] =
                                            (-1) * HelpNumber.ParseDecimal(rowLast[Des.GetSOLGField()]);
                                    }

                                    rowLast[Des.GetTRLGField()] =
                                        HelpNumber.ParseDecimal(rowLast[Des.GetTRLGField()]) -
                                        HelpNumber.ParseDecimal(rowFirst[Des.GetTRLGField()]);
                                    if (HelpNumber.ParseDecimal(rowLast[Des.GetTRLGField()]) > 0)
                                        rowLast[Des.GetTRLGField()] = 0;
                                    else
                                    {
                                        rowLast[Des.GetTRLGField()] =
                                            (-1) * HelpNumber.ParseDecimal(rowLast[Des.GetTRLGField()]);
                                    }
                                }
                            }
                        }
                    }
                }
                List<DataRow> row_deleted = new List<DataRow>();
                foreach (DataRow rowFirst in GridDataSetSrc.Tables[0].Rows)
                {
                    bool IsRowDeleted = false;
                    foreach (DataRow rowLast in DetailDataSet.Tables[0].Rows)
                    {
                        if (rowLast.RowState != DataRowState.Deleted &&
                            (HelpNumber.ParseInt64(rowLast["HH_ID"]) ==
                            HelpNumber.ParseInt64(rowFirst["HH_ID"]))
                            && (HelpNumber.ParseInt64(rowLast[Des.GetSTTField()]) ==
                            HelpNumber.ParseInt64(rowFirst[Des.GetSTTField()])))
                            IsRowDeleted = true;
                    }
                    if (!IsRowDeleted)
                        row_deleted.Add(rowFirst);
                }
                foreach (DataRow row in row_deleted)
                    DetailDataSet.Tables[0].ImportRow(row);
                this.DetailDataTable = DetailDataSet.Tables[0];
            }
            this.Des = Des;
            this.Ngay_phat_sinh = Ngay_Nhap;
            this.Kho_Id = Kho_Id;
        }
Esempio n. 27
0
 public RBTienThanhToanExt(PhieuType Src, long SrcID, PhieuType Des, long DesID,
     object DesObj, PLGridView DesGrid)
 {
     this.Src = Src;
     this.SrcID = SrcID;
     this.Des = Des;
     this.DesID = DesID;
     this.DesObj = DesObj;
     this.DesGrid = DesGrid;
 }