Example #1
0
        public static void Save(ref DataTable dt)
        {
            DataTable dtRemine;

            dtRemine = dt.GetChanges();
            if (dtRemine != null)
            {
                foreach (DataRow item in dtRemine.Rows)
                {
                    BaoLoiModel model = new BaoLoiModel();

                    model.VanDe        = item["VanDe"].ToString();
                    model.HangMuc      = item["HangMuc"].ToString();
                    model.YeuCau       = item["YeuCau"].ToString();
                    model.MucDoUuTien  = item["MucDoUuTien"].ToString();
                    model.TinhTrangLoi = item["TinhTrangLoi"].ToString();
                    model.FileDinhKem  = Path.GetFileName(item["FileDinhKem"].ToString());
                    if (item["FileDinhKem"].ToString().Contains("\\"))
                    {
                        File.Copy(item["FileDinhKem"].ToString(), sPath + model.FileDinhKem, true);
                    }
                    if (item["ID"] == DBNull.Value) //add new)
                    {
                        model.NguoiPhatHien = Global.AppFullName;
                        model.NgayYeuCau    = (DateTime.Now);
                        BaoLoiBO.Instance.Insert(model);
                    }
                    else
                    {
                        model.NgayYeuCau        = Convert.ToDateTime(item["NgayYeuCau"].ToString());
                        model.TinhTrangKhacPhuc = (item["TinhTrangKhacPhuc"].ToString());
                        model.NguoiKhacPhuc     = item["NguoiKhacPhuc"].ToString();
                        //model.NgayKhacPhucXong = TextUtils.ToDate(item["NgayKhacPhucXong"].ToString());
                        model.ID = Convert.ToInt32(item["ID"].ToString());
                        BaoLoiBO.Instance.Update(model);
                    }
                }
            }
        }
Example #2
0
 protected BaoLoiFacade(BaoLoiModel model) : base(model)
 {
 }