private List <GDICH_KSOAT> GetFormData() { List <GDICH_KSOAT> lstGdich = new List <GDICH_KSOAT>(); foreach (DataRow dr in _dtGiaoDich.Rows) { if (Convert.ToBoolean(dr["CHON"]) == true) { GDICH_KSOAT obj = new GDICH_KSOAT(); obj.DIEN_GIAI = dr["DIEN_GIAI"].ToString(); obj.ID_GDICH = Convert.ToInt32(dr["ID"]); obj.LY_DO = dr["LY_DO"].ToString(); obj.MA_DVI = dr["MA_DVI"].ToString(); obj.MA_GDICH = dr["SO_GDICH"].ToString(); obj.MA_LOAI_GDICH = DatabaseConstant.layLoaiGiaoDich(dr["MA_LOAI_GDICH"].ToString()); obj.MA_PHAN_HE = DatabaseConstant.getModule(dr["MA_PHAN_HE"].ToString()); obj.NGAY_GDICH = dr["NGAY_GIAO_DICH"].ToString(); obj.NGAY_CNHAT = Presentation.Process.Common.ClientInformation.NgayLamViecHienTai; obj.NGUOI_CNHAT = Presentation.Process.Common.ClientInformation.TenDangNhap; obj.NGUOI_NHAP = dr["NGUOI_NHAP"].ToString(); obj.NGAY_NHAP = dr["NGAY_NHAP"].ToString(); obj.MA_CNANG = dr["MA_CNANG"].ToString(); //if (_action != DatabaseConstant.Action.XOA) //{ // string tthai_nvu = CommonFunction.LayTrangThaiBanGhi(_action, BusinessConstant.layTrangThaiNghiepVu(dr["TTHAI_NVU"].ToString())); // obj.TTHAI_NVU = tthai_nvu; //} //else //{ obj.TTHAI_NVU = dr["TTHAI_NVU"].ToString(); //} lstGdich.Add(obj); } } return(lstGdich); }
private List <string> TuChoi(string pv_strListItem) { List <string> listResult = new List <string>(); if (pv_strListItem != "") { List <GDICH_KSOAT> lstGdich = new List <GDICH_KSOAT>(); List <int> lstID = GetListIdLock(pv_strListItem); string[] str = pv_strListItem.Split(';'); if (str != null && str.Length > 0) { for (int k = 0; k < str.Length; k++) { DataView v_dv = ListGiaoDich.DefaultView; v_dv.RowFilter = ""; v_dv.RowFilter = "ID=" + str[k]; if (v_dv.Count > 0) { GDICH_KSOAT obj = new GDICH_KSOAT(); obj.DIEN_GIAI = v_dv[0]["DIEN_GIAI"].ToString(); obj.ID_GDICH = Convert.ToInt32(v_dv[0]["ID"]); obj.LY_DO = v_dv[0]["LY_DO"].ToString(); obj.MA_DVI = v_dv[0]["MA_DVI"].ToString(); obj.MA_GDICH = v_dv[0]["SO_GDICH"].ToString(); obj.MA_LOAI_GDICH = DatabaseConstant.layLoaiGiaoDich(v_dv[0]["MA_LOAI_GDICH"].ToString()); obj.MA_PHAN_HE = DatabaseConstant.getModule(v_dv[0]["MA_PHAN_HE"].ToString()); obj.NGAY_GDICH = v_dv[0]["NGAY_GIAO_DICH"].ToString(); obj.NGAY_CNHAT = AppConfig.LoginedUser.NgayLamViecHienTai; obj.NGUOI_CNHAT = AppConfig.LoginedUser.UserName; obj.NGUOI_NHAP = v_dv[0]["NGUOI_NHAP"].ToString(); obj.NGAY_NHAP = v_dv[0]["NGAY_NHAP"].ToString(); obj.MA_CNANG = v_dv[0]["MA_CNANG"].ToString(); lstGdich.Add(obj); } } List <ClientResponseDetail> lstResponseDetail = new List <ClientResponseDetail>(); ApplicationConstant.ResponseStatus status = ApplicationConstant.ResponseStatus.KHONG_THANH_CONG; Presentation.Process.KeToanProcess process = new Presentation.Process.KeToanProcess(); // Yêu cầu lock bản ghi cần xử lý UtilitiesProcess Lockprocess = new UtilitiesProcess(); bool ret = Lockprocess.LockData(DatabaseConstant.Module.GDKT, DatabaseConstant.Function.KT_GIAO_DICH, DatabaseConstant.Table.KT_GIAO_DICH, DatabaseConstant.Action.TU_CHOI_DUYET, lstID); bool retUnlockData = Lockprocess.UnlockData(DatabaseConstant.Module.GDKT, DatabaseConstant.Function.KT_GIAO_DICH, DatabaseConstant.Table.KT_GIAO_DICH, DatabaseConstant.Action.TU_CHOI_DUYET, lstID); if (ret) { status = process.KiemSoatGiaoDich(lstGdich, DatabaseConstant.Action.TU_CHOI_DUYET, ref lstResponseDetail); if (status == ApplicationConstant.ResponseStatus.THANH_CONG) { foreach (ClientResponseDetail cl in lstResponseDetail) { listResult.Add(LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Result) + "#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, cl.Detail.Split('#')[0])); } } else { listResult.Add("M.DungChung.DuyetKhongThanhCong#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, "M.DungChung.DuyetKhongThanhCong")); } } else { listResult.Add("M.ResponseMessage.Common.LockDataInvalid#" + LanguageEngine.Instance().GetContent(LanguageType.TypeMessage, "M.ResponseMessage.Common.LockDataInvalid")); } } } return(listResult); }