Int64 IAPForwardInfoDataAccess.Delete(APForwardInfoEntity aPForwardInfoEntity, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran) { try { long retValues = -99; switch (reqTran) { case TransactionRequired.No: { retValues = Delete(aPForwardInfoEntity, filterExpression, option); break; } case TransactionRequired.Yes: { retValues = DeleteTran(aPForwardInfoEntity, filterExpression, option); break; } default: { retValues = -99; break; } } return(retValues); } catch (Exception ex) { throw ex; } }
Int64 IAPForwardInfoDataAccess.Add(APForwardInfoEntity aPForwardInfoEntity, DatabaseOperationType option, TransactionRequired reqTran) { try { long retValues = -99; switch (reqTran) { case TransactionRequired.No: { retValues = Add(aPForwardInfoEntity, option); break; } case TransactionRequired.Yes: { retValues = AddTran(aPForwardInfoEntity, option); break; } default: { retValues = -99; break; } } return(retValues); } catch (Exception ex) { throw ex; } }
private Int64 UpdateTran(APForwardInfoEntity aPForwardInfoEntity, String filterExpression, DatabaseOperationType option) { long returnCode = -99; const string SP = "dbo.APForwardInfo_SET"; Database db = DatabaseFactory.CreateDatabase(); using (DbCommand cmd = db.GetStoredProcCommand(SP)) { AddOptionParameter(cmd, option, db); AddOutputParameter(cmd, db); AddFilterExpressionParameter(cmd, filterExpression, db); db.AddInParameter(cmd, "@APForwardInfoID", DbType.Int64, aPForwardInfoEntity.APForwardInfoID); db.AddInParameter(cmd, "@APMemberFeedbackID", DbType.Int64, aPForwardInfoEntity.APMemberFeedbackID); db.AddInParameter(cmd, "@APApprovalProcessID", DbType.Int64, aPForwardInfoEntity.APApprovalProcessID); db.AddInParameter(cmd, "@APMemberFeedbackRemarksID", DbType.Int64, aPForwardInfoEntity.APMemberFeedbackRemarksID); db.AddInParameter(cmd, "@DepartmentID", DbType.Int64, aPForwardInfoEntity.DepartmentID); db.AddInParameter(cmd, "@EmployeeID", DbType.Int64, aPForwardInfoEntity.EmployeeID); db.AddInParameter(cmd, "@CommentRequestDate", DbType.DateTime, aPForwardInfoEntity.CommentRequestDate); db.AddInParameter(cmd, "@CommentSubmitDate", DbType.DateTime, aPForwardInfoEntity.CommentSubmitDate); db.AddInParameter(cmd, "@APMemberComment", DbType.String, aPForwardInfoEntity.APMemberComment); db.AddInParameter(cmd, "@APForwardMemberComment", DbType.String, aPForwardInfoEntity.APForwardMemberComment); DbConnection connection = db.CreateConnection(); connection.Open(); DbTransaction transaction = connection.BeginTransaction(); try { using (IDataReader reader = db.ExecuteReader(cmd, transaction)) { returnCode = GetReturnCodeFromParameter(cmd); } if (returnCode > 0) { transaction.Commit(); } else { throw new ArgumentException("Error Code." + returnCode.ToString()); } } catch (Exception ex) { transaction.Rollback(); throw ex; } finally { transaction.Dispose(); connection.Close(); connection = null; } } return(returnCode); }
private void SaveAPForwardInfoEntity() { if (IsValid) { try { APForwardInfoEntity aPForwardInfoEntity = BuildAPForwardInfoEntity(); Int64 result = -1; if (aPForwardInfoEntity.IsNew) { result = FCCAPForwardInfo.GetFacadeCreate().Add(aPForwardInfoEntity, DatabaseOperationType.Add, TransactionRequired.No); } else { String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(APForwardInfoEntity.FLD_NAME_APForwardInfoID, aPForwardInfoEntity.APForwardInfoID.ToString(), SQLMatchType.Equal); result = FCCAPForwardInfo.GetFacadeCreate().Update(aPForwardInfoEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No); } if (result > 0) { _APForwardInfoID = 0; _APForwardInfoEntity = new APForwardInfoEntity(); PrepareInitialView(); BindAPForwardInfoList(); if (aPForwardInfoEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "A PForward Info Information has been added successfully.", false); } else { MiscUtil.ShowMessage(lblMessage, "A PForward Info Information has been updated successfully.", false); } } else { if (aPForwardInfoEntity.IsNew) { MiscUtil.ShowMessage(lblMessage, "Failed to add A PForward Info Information.", false); } else { MiscUtil.ShowMessage(lblMessage, "Failed to update A PForward Info Information.", false); } } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } }
protected void lvAPForwardInfo_ItemCommand(object sender, ListViewCommandEventArgs e) { Int64 APForwardInfoID; Int64.TryParse(e.CommandArgument.ToString(), out APForwardInfoID); if (APForwardInfoID > 0) { if (string.Equals(e.CommandName, "EditItem")) { _APForwardInfoID = APForwardInfoID; PrepareEditView(); cpeEditor.Collapsed = false; cpeEditor.ClientState = "false"; } else if (string.Equals(e.CommandName, "DeleteItem")) { try { Int64 result = -1; String fe = SqlExpressionBuilder.PrepareFilterExpression(APForwardInfoEntity.FLD_NAME_APForwardInfoID, APForwardInfoID.ToString(), SQLMatchType.Equal); APForwardInfoEntity aPForwardInfoEntity = new APForwardInfoEntity(); result = FCCAPForwardInfo.GetFacadeCreate().Delete(aPForwardInfoEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No); if (result == 0) { _APForwardInfoID = 0; _APForwardInfoEntity = new APForwardInfoEntity(); PrepareInitialView(); BindAPForwardInfoList(); MiscUtil.ShowMessage(lblMessage, "A PForward Info has been successfully deleted.", true); } else { MiscUtil.ShowMessage(lblMessage, "Failed to delete A PForward Info.", true); } } catch (Exception ex) { MiscUtil.ShowMessage(lblMessage, ex.Message, true); } } } }
private Int64 DeleteTran(APForwardInfoEntity aPForwardInfoEntity, String filterExpression, DatabaseOperationType option) { long returnCode = -99; const string SP = "dbo.APForwardInfo_SET"; Database db = DatabaseFactory.CreateDatabase(); using (DbCommand cmd = db.GetStoredProcCommand(SP)) { AddOptionParameter(cmd, option); AddOutputParameter(cmd, db); AddFilterExpressionParameter(cmd, filterExpression, db); DbConnection connection = db.CreateConnection(); connection.Open(); DbTransaction transaction = connection.BeginTransaction(); try { using (IDataReader reader = db.ExecuteReader(cmd, transaction)) { returnCode = GetReturnCodeFromParameter(cmd); } if (returnCode >= 0) { transaction.Commit(); } else { throw new ArgumentException("Error Code." + returnCode.ToString()); } } catch (Exception ex) { transaction.Rollback(); throw ex; } finally { transaction.Dispose(); connection.Close(); connection = null; } } return(returnCode); }
private Int64 Update(APForwardInfoEntity aPForwardInfoEntity, String filterExpression, DatabaseOperationType option) { long returnCode = -99; const string SP = "dbo.APForwardInfo_SET"; using (DbCommand cmd = Database.GetStoredProcCommand(SP)) { AddOptionParameter(cmd, option); AddOutputParameter(cmd); AddFilterExpressionParameter(cmd, filterExpression); Database.AddInParameter(cmd, "@APForwardInfoID", DbType.Int64, aPForwardInfoEntity.APForwardInfoID); Database.AddInParameter(cmd, "@APMemberFeedbackID", DbType.Int64, aPForwardInfoEntity.APMemberFeedbackID); Database.AddInParameter(cmd, "@APApprovalProcessID", DbType.Int64, aPForwardInfoEntity.APApprovalProcessID); Database.AddInParameter(cmd, "@APMemberFeedbackRemarksID", DbType.Int64, aPForwardInfoEntity.APMemberFeedbackRemarksID); Database.AddInParameter(cmd, "@DepartmentID", DbType.Int64, aPForwardInfoEntity.DepartmentID); Database.AddInParameter(cmd, "@EmployeeID", DbType.Int64, aPForwardInfoEntity.EmployeeID); Database.AddInParameter(cmd, "@CommentRequestDate", DbType.DateTime, aPForwardInfoEntity.CommentRequestDate); Database.AddInParameter(cmd, "@CommentSubmitDate", DbType.DateTime, aPForwardInfoEntity.CommentSubmitDate); Database.AddInParameter(cmd, "@APMemberComment", DbType.String, aPForwardInfoEntity.APMemberComment); Database.AddInParameter(cmd, "@APForwardMemberComment", DbType.String, aPForwardInfoEntity.APForwardMemberComment); using (IDataReader reader = Database.ExecuteReader(cmd)) { returnCode = GetReturnCodeFromParameter(cmd); switch (returnCode) { case SqlConstants.DB_STATUS_CODE_DATAALREADYEXIST: { throw new ArgumentException("APForwardInfoEntity already exists. Please specify another APForwardInfoEntity."); } case SqlConstants.DB_STATUS_CODE_DATAUPDATEDFROMOTHERSESSION: { throw new ArgumentException("APForwardInfoEntity data already updated from different session."); } case SqlConstants.DB_STATUS_CODE_FAIL_OPERATION: { throw new ArgumentException("APForwardInfoEntity already exists. Please specify another APForwardInfoEntity."); } } } } return(returnCode); }
private void PrepareEditView() { APForwardInfoEntity aPForwardInfoEntity = CurrentAPForwardInfoEntity; if (!aPForwardInfoEntity.IsNew) { if (ddlAPMemberFeedbackID.Items.Count > 0 && aPForwardInfoEntity.APMemberFeedbackID != null) { ddlAPMemberFeedbackID.SelectedValue = aPForwardInfoEntity.APMemberFeedbackID.ToString(); } if (ddlAPApprovalProcessID.Items.Count > 0 && aPForwardInfoEntity.APApprovalProcessID != null) { ddlAPApprovalProcessID.SelectedValue = aPForwardInfoEntity.APApprovalProcessID.ToString(); } if (ddlAPMemberFeedbackRemarksID.Items.Count > 0 && aPForwardInfoEntity.APMemberFeedbackRemarksID != null) { ddlAPMemberFeedbackRemarksID.SelectedValue = aPForwardInfoEntity.APMemberFeedbackRemarksID.ToString(); } if (ddlDepartmentID.Items.Count > 0 && aPForwardInfoEntity.DepartmentID != null) { ddlDepartmentID.SelectedValue = aPForwardInfoEntity.DepartmentID.ToString(); } if (ddlEmployeeID.Items.Count > 0 && aPForwardInfoEntity.EmployeeID != null) { ddlEmployeeID.SelectedValue = aPForwardInfoEntity.EmployeeID.ToString(); } txtCommentRequestDate.Text = aPForwardInfoEntity.CommentRequestDate.ToStringDefault(); txtCommentSubmitDate.Text = aPForwardInfoEntity.CommentSubmitDate.ToStringDefault(); txtAPMemberComment.Text = aPForwardInfoEntity.APMemberComment.ToString(); txtAPForwardMemberComment.Text = aPForwardInfoEntity.APForwardMemberComment.ToString(); btnSubmit.Text = "Update"; btnAddNew.Visible = true; } }
private Int64 Delete(APForwardInfoEntity aPForwardInfoEntity, String filterExpression, DatabaseOperationType option) { long returnCode = -99; const string SP = "dbo.APForwardInfo_SET"; using (DbCommand cmd = Database.GetStoredProcCommand(SP)) { AddOptionParameter(cmd, option); AddOutputParameter(cmd); AddFilterExpressionParameter(cmd, filterExpression); using (IDataReader reader = Database.ExecuteReader(cmd)) { returnCode = GetReturnCodeFromParameter(cmd); switch (returnCode) { case SqlConstants.DB_STATUS_CODE_DATAALREADYEXIST: { throw new ArgumentException("APForwardInfoEntity already exists. Please specify another APForwardInfoEntity."); } case SqlConstants.DB_STATUS_CODE_DATAUPDATEDFROMOTHERSESSION: { throw new ArgumentException("APForwardInfoEntity data already updated from different session."); } case SqlConstants.DB_STATUS_CODE_FAIL_OPERATION: { throw new ArgumentException("APForwardInfoEntity already exists. Please specify another APForwardInfoEntity."); } } } } return(returnCode); }
protected void btnForward_Click(object sender, EventArgs e) { btnForward.Enabled = false; if (ddlRejectTo.Items.Count > 0) { APRobot.UpdateMemberFeedbackFeedback(APMemberFeedbackID, MasterDataConstants.APFeedback.FORWARDED); APRobot.UpdateMemberFeedbackLastResponseDate(APMemberFeedbackID, DateTime.Now); String remarks = txtRemarks.Text.Trim(); if (remarks.IsNullOrEmpty()) { remarks = "Forwarded"; } remarks = AddProxyMemberInfo(remarks); Int64 aPMemberFeedbackRemarksID = APRobot.AddAPMemberFeedbackRemarks(APMemberFeedbackID, remarks); Int64 aPPanelForwardMemberID = Int64.Parse(ddlForwardTo.SelectedValue); APPanelForwardMemberEntity aPPanelForwardMemberEntity = APRobot.GetAPPanelForwardMemberByID(aPPanelForwardMemberID); APForwardInfoEntity aPForwardInfoEntity = new APForwardInfoEntity(); aPForwardInfoEntity.APMemberFeedbackID = APMemberFeedbackID; aPForwardInfoEntity.APApprovalProcessID = APApprovalProcessID; aPForwardInfoEntity.APMemberFeedbackRemarksID = aPMemberFeedbackRemarksID; aPForwardInfoEntity.DepartmentID = aPPanelForwardMemberEntity.DepartmentID; aPForwardInfoEntity.EmployeeID = aPPanelForwardMemberEntity.EmployeeID; aPForwardInfoEntity.CommentRequestDate = DateTime.Now; aPForwardInfoEntity.CommentSubmitDate = null; aPForwardInfoEntity.APMemberComment = txtForwardRemarks.Text.Trim(); aPForwardInfoEntity.APForwardMemberComment = String.Empty; FCCAPForwardInfo.GetFacadeCreate().Add(aPForwardInfoEntity, DatabaseOperationType.Add, TransactionRequired.No); MiscUtil.ShowMessage(lblMessage, "You have forwarded the thread successfully", UIConstants.MessageType.GREEN); PrepareInitialView(); BindList(); #region Forwarded Mail String MailBody = String.Empty; String Subject = String.Empty; StringBuilder sb = new StringBuilder(); sb.Append("Dear Sir,"); sb.Append("<br/>"); sb.Append("This is a auto generated mail from the ERP."); sb.Append("<br/>"); sb.Append("A Requisition Forwarded Request is waiting for your approval"); sb.Append("<br/>"); sb.Append("-"); sb.Append("<br/>"); sb.Append("Thanks"); sb.Append("<br/>"); sb.Append("ERP System"); MailBody = sb.ToString(); Subject = "ERP, Requsition, Forwarded"; HREmployeeEntity _hREmployeeEntity = FCCHREmployee.GetFacadeCreate().GetByID(aPForwardInfoEntity.EmployeeID); if (_hREmployeeEntity != null) { String[] sendToMail = new String[] { _hREmployeeEntity.PrimaryEmail }; MiscUtil.SendMail(sendToMail, Subject, MailBody); } #endregion RedirectPageToForwardList(); } else { MiscUtil.ShowMessage(lblMessage, "Failed to forward", UIConstants.MessageType.RED); } }
protected void btnForward_Click(object sender, EventArgs e) { if (chbxAutoForwardTo.Checked) { APApprovalProcessEntity aPApprovalProcessEntity = APRobot.GetApprovalProcessByTypeAndReference(MasterDataConstants.APType.BILL, CMBillID); IList <APMemberFeedbackEntity> feedbackList = APRobot.GetAllMemberFeedbacks(aPApprovalProcessEntity.APApprovalProcessID); IList <APMemberFeedbackEntity> ordered_list = feedbackList.OrderBy(x => x.SequenceNo).ToList(); APPanelForwardMemberEntity aPPanelForwardMemberEntity = APRobot.GetAPPanelForwardMemberByID(Int64.Parse(ddlForwardTo.SelectedValue)); var existsInfo = (from s in ordered_list where s.EmployeeID.ToString() == aPPanelForwardMemberEntity.EmployeeID.ToString() select s); if (existsInfo != null && existsInfo.Count() > 0) { MiscUtil.ShowMessage(lblMessage, "Member Already Exists in the Approval Panel", true); return; } APMemberFeedbackEntity currentEmployeeInfo = (from r in ordered_list where r.EmployeeID.ToString() == MiscUtil.GetCurrentEmployeeByMemberID(CurrentMember).ToString() select r).FirstOrDefault(); if (currentEmployeeInfo != null) { ordered_list = (from m in ordered_list where m.SequenceNo > currentEmployeeInfo.SequenceNo select m).ToList(); APMemberFeedbackEntity aPMemberFeedbackEntity = new APMemberFeedbackEntity(); aPMemberFeedbackEntity.APApprovalProcessID = aPApprovalProcessEntity.APApprovalProcessID; aPMemberFeedbackEntity.DepartmentID = aPPanelForwardMemberEntity.DepartmentID; aPMemberFeedbackEntity.EmployeeID = aPPanelForwardMemberEntity.EmployeeID; aPMemberFeedbackEntity.SequenceNo = currentEmployeeInfo.SequenceNo + 1; aPMemberFeedbackEntity.APFeedbackID = MasterDataConstants.APFeedback.NOT_YET_REQUESTED; aPMemberFeedbackEntity.FeedbackRequestDate = DateTime.Now; aPMemberFeedbackEntity.FeedbackLastResponseDate = null; aPMemberFeedbackEntity.FeedbackSubmitDate = null; aPMemberFeedbackEntity.IsProxyEmployeeEnabled = false; aPMemberFeedbackEntity.ProxyEmployeeID = null; Int64 aPMemberFeedbackID = FCCAPMemberFeedback.GetFacadeCreate().Add(aPMemberFeedbackEntity, DatabaseOperationType.Add, TransactionRequired.No); foreach (APMemberFeedbackEntity ent in ordered_list) { String fe = SqlExpressionBuilder.PrepareFilterExpression(APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, ent.APMemberFeedbackID.ToString(), SQLMatchType.Equal); ent.SequenceNo += 1; FCCAPMemberFeedback.GetFacadeCreate().Update(ent, fe, DatabaseOperationType.Update, TransactionRequired.No); } APRobot.UpdateApprovalProcessFeedback(APMemberFeedbackID, MasterDataConstants.APFeedback.APPROVED, MasterDataConstants.APType.BILL, CMBillID); String remarks = txtRemarks.Text.Trim(); if (remarks.IsNullOrEmpty()) { remarks = "Approved"; } remarks = AddProxyMemberInfo(remarks); APRobot.AddAPMemberFeedbackRemarks(APMemberFeedbackID, remarks); EnableDisableApprovalButtons(); MiscUtil.ShowMessage(lblMessage, "You have Approved Successfully", UIConstants.MessageType.GREEN); PrepareInitialView(); BindList(); RedirectPageToPendingList(); } } //Previous Code else { if (ddlRejectTo.Items.Count > 0) { APRobot.UpdateMemberFeedbackFeedback(APMemberFeedbackID, MasterDataConstants.APFeedback.FORWARDED); APRobot.UpdateMemberFeedbackLastResponseDate(APMemberFeedbackID, DateTime.Now); String remarks = txtRemarks.Text.Trim(); if (remarks.IsNullOrEmpty()) { remarks = "Forwarded"; } remarks = AddProxyMemberInfo(remarks); Int64 aPMemberFeedbackRemarksID = APRobot.AddAPMemberFeedbackRemarks(APMemberFeedbackID, remarks); Int64 aPPanelForwardMemberID = Int64.Parse(ddlForwardTo.SelectedValue); APPanelForwardMemberEntity aPPanelForwardMemberEntity = APRobot.GetAPPanelForwardMemberByID(aPPanelForwardMemberID); APForwardInfoEntity aPForwardInfoEntity = new APForwardInfoEntity(); aPForwardInfoEntity.APMemberFeedbackID = APMemberFeedbackID; aPForwardInfoEntity.APApprovalProcessID = APApprovalProcessID; aPForwardInfoEntity.APMemberFeedbackRemarksID = aPMemberFeedbackRemarksID; aPForwardInfoEntity.DepartmentID = aPPanelForwardMemberEntity.DepartmentID; aPForwardInfoEntity.EmployeeID = aPPanelForwardMemberEntity.EmployeeID; aPForwardInfoEntity.CommentRequestDate = DateTime.Now; aPForwardInfoEntity.CommentSubmitDate = null; aPForwardInfoEntity.APMemberComment = txtForwardRemarks.Text.Trim(); aPForwardInfoEntity.APForwardMemberComment = String.Empty; FCCAPForwardInfo.GetFacadeCreate().Add(aPForwardInfoEntity, DatabaseOperationType.Add, TransactionRequired.No); MiscUtil.ShowMessage(lblMessage, "You have forwarded the thread successfully", UIConstants.MessageType.GREEN); PrepareInitialView(); BindList(); #region Forwarded Mail String MailBody = String.Empty; String Subject = String.Empty; StringBuilder sb = new StringBuilder(); sb.Append("Dear Sir,"); sb.Append("<br/>"); sb.Append("This is a auto generated mail from the ERP."); sb.Append("<br/>"); sb.Append("A Bill Request is Forwarded Request is waiting for your approval"); sb.Append("<br/>"); sb.Append("<br/>"); sb.Append("-"); sb.Append("<br/>"); sb.Append("Thanks"); sb.Append("<br/>"); sb.Append("ERP System"); MailBody = sb.ToString(); Subject = "ERP, Bill, Forwarded"; MailBody = @"Please note that a Bill is Forwarded.-Thanks ERP System"; HREmployeeEntity _hREmployeeEntity = FCCHREmployee.GetFacadeCreate().GetByID(aPForwardInfoEntity.EmployeeID); if (_hREmployeeEntity != null) { String[] sendToMail = new String[] { _hREmployeeEntity.PrimaryEmail }; MiscUtil.SendMail(sendToMail, Subject, MailBody); } #endregion //RedirectPageToForwardList(); } else { MiscUtil.ShowMessage(lblMessage, "Failed to forward", UIConstants.MessageType.RED); } } }
Int64 IAPForwardInfoFacade.Delete(APForwardInfoEntity aPForwardInfoEntity, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran) { return(DataAccessFactory.CreateAPForwardInfoDataAccess().Delete(aPForwardInfoEntity, filterExpression, option, reqTran)); }
Int64 IAPForwardInfoFacade.Add(APForwardInfoEntity aPForwardInfoEntity, DatabaseOperationType option, TransactionRequired reqTran) { return(DataAccessFactory.CreateAPForwardInfoDataAccess().Add(aPForwardInfoEntity, option, reqTran)); }
protected void btnAddNew_Click(object sender, EventArgs e) { _APForwardInfoID = 0; _APForwardInfoEntity = new APForwardInfoEntity(); PrepareInitialView(); }
private APForwardInfoEntity BuildAPForwardInfoEntity() { APForwardInfoEntity aPForwardInfoEntity = CurrentAPForwardInfoEntity; if (ddlAPMemberFeedbackID.Items.Count > 0) { if (ddlAPMemberFeedbackID.SelectedValue == "0") { } else { aPForwardInfoEntity.APMemberFeedbackID = Int64.Parse(ddlAPMemberFeedbackID.SelectedValue); } } if (ddlAPApprovalProcessID.Items.Count > 0) { if (ddlAPApprovalProcessID.SelectedValue == "0") { } else { aPForwardInfoEntity.APApprovalProcessID = Int64.Parse(ddlAPApprovalProcessID.SelectedValue); } } if (ddlAPMemberFeedbackRemarksID.Items.Count > 0) { if (ddlAPMemberFeedbackRemarksID.SelectedValue == "0") { } else { aPForwardInfoEntity.APMemberFeedbackRemarksID = Int64.Parse(ddlAPMemberFeedbackRemarksID.SelectedValue); } } if (ddlDepartmentID.Items.Count > 0) { if (ddlDepartmentID.SelectedValue == "0") { } else { aPForwardInfoEntity.DepartmentID = Int64.Parse(ddlDepartmentID.SelectedValue); } } if (ddlEmployeeID.Items.Count > 0) { if (ddlEmployeeID.SelectedValue == "0") { } else { aPForwardInfoEntity.EmployeeID = Int64.Parse(ddlEmployeeID.SelectedValue); } } if (txtCommentRequestDate.Text.Trim().IsNotNullOrEmpty()) { aPForwardInfoEntity.CommentRequestDate = MiscUtil.ParseToDateTime(txtCommentRequestDate.Text); } if (txtCommentSubmitDate.Text.Trim().IsNotNullOrEmpty()) { aPForwardInfoEntity.CommentSubmitDate = MiscUtil.ParseToDateTime(txtCommentSubmitDate.Text); } else { aPForwardInfoEntity.CommentSubmitDate = null; } aPForwardInfoEntity.APMemberComment = txtAPMemberComment.Text.Trim(); aPForwardInfoEntity.APForwardMemberComment = txtAPForwardMemberComment.Text.Trim(); return(aPForwardInfoEntity); }