private void SetFormData() { try { SYS_JOB_SUBSCRIBE obj = new SYS_JOB_SUBSCRIBE(); List <SYS_JOB_SUBSCRIBE> lstDoiTuong = new List <SYS_JOB_SUBSCRIBE>(); obj.ID = id; JobProcess process = new JobProcess(); bool ret = false; string sMessage = ""; ret = process.SysJobSubscribe(DatabaseConstant.Action.LOAD, ref loaiDoiTuong, ref obj, ref lstDoiTuong, ref sMessage); if (obj != null) { txtName.Text = obj.SUB_NAME; txtDescription.Text = obj.DESCRIPTION; txtEmail.Text = obj.SUB_EMAIL; bool status = obj.SUB_STATUS.Equals("DEACTIVE") ? true : false; chkStatusDeactive.IsChecked = status; } } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); throw ex; } }
private void btnSave_Click(object sender, RoutedEventArgs e) { try { if (Validation()) { SYS_JOB_SUBSCRIBE obj = new SYS_JOB_SUBSCRIBE(); List <SYS_JOB_SUBSCRIBE> lstDoiTuong = new List <SYS_JOB_SUBSCRIBE>(); GetFormData(ref obj); JobProcess process = new JobProcess(); bool ret = false; string sMessage = ""; ret = process.SysJobSubscribe(DatabaseConstant.Action.CAU_HINH, ref loaiDoiTuong, ref obj, ref lstDoiTuong, ref sMessage); if (ret) { LMessage.ShowMessage("Insert/Update successfull", LMessage.MessageBoxType.Warning); return; } else { LMessage.ShowMessage("Insert/Update failed", LMessage.MessageBoxType.Warning); return; } } } catch (System.Exception ex) { CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } }
public bool SysJobHis(DatabaseConstant.Action Action, ref string maDoiTuong, ref SYS_JOB_SUBSCRIBE objSysJobSubscribe, ref List <SYS_JOB_HIS> lstSysJobHis, ref string sMessage) { // Kiểm tra kết nối, server, service trước khi request Common.Utilities.IsRequestAllow(ApplicationConstant.SystemService.JobService.layGiaTri()); // Khởi tạo và gán giá trị cho request JobRequest request = Common.Utilities.PrepareRequest(new JobRequest()); request.Function = DatabaseConstant.Function.SYS_JOB_HIS; request.Action = Action; request.maDoiTuong = maDoiTuong; request.objSysJobSubscribe = objSysJobSubscribe; request.lstSysJobHis = lstSysJobHis.ToArray(); JobResponse response = Client.Job(request); //Kiểm tra kết quả trả về Common.Utilities.ValidResponse(request, response); if (response != null && response.ResponseStatus == ApplicationConstant.ResponseStatus.THANH_CONG) { objSysJobSubscribe = response.objSysJobSubscribe; if (lstSysJobHis != null) { lstSysJobHis = response.lstSysJobHis.ToList(); } sMessage = response.ResponseMessage; return(true); } else { sMessage = response.ResponseMessage; return(false); } }
private void GetFormData(ref SYS_JOB_SUBSCRIBE obj) { try { obj.ID = id; obj.SUB_NAME = txtName.Text; obj.DESCRIPTION = txtDescription.Text; obj.SUB_EMAIL = txtEmail.Text; string status = chkStatusDeactive.IsChecked == true ? "DEACTIVE" : "ACTIVE"; obj.SUB_STATUS = status; obj.JOB_CODE = loaiDoiTuong; } catch (Exception ex) { LLogging.WriteLog(ex.TargetSite.Name, LLogging.LogType.ERR, ex); throw ex; } }
/// <summary> /// Xóa dữ liệu /// </summary> private void onDelete(List <int> listId, string loaiDoiTuong) { Mouse.OverrideCursor = Cursors.Wait; try { List <ClientResponseDetail> listClientResponseDetail = new List <ClientResponseDetail>(); bool ret = true; string sMessage = ""; lstDoiTuong = new List <SYS_JOB_SUBSCRIBE>(); foreach (int item in listId) { SYS_JOB_SUBSCRIBE obj = new SYS_JOB_SUBSCRIBE(); obj.ID = item; lstDoiTuong.Add(obj); } ret = job.SysJobSubscribe(DatabaseConstant.Action.XOA, ref loaiDoiTuong, ref doiTuong, ref lstDoiTuong, ref sMessage); afterDelete(ret, listId, listClientResponseDetail, loaiDoiTuong); } catch (System.Exception ex) { // Yêu cầu unlock dữ liệu UtilitiesProcess lockProcess = new UtilitiesProcess(); bool retUnlockData = true; retUnlockData = lockProcess.LockData(DatabaseConstant.Module.QTHT, DatabaseConstant.Function.SYS_JOB_SUBSCRIBE, DatabaseConstant.Table.HT_NSD, DatabaseConstant.Action.XOA, listId); this.Cursor = Cursors.Arrow; CommonFunction.ThongBaoLoi(ex); LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex); } Mouse.OverrideCursor = Cursors.Arrow; }