protected void btnSave_Click(object sender, EventArgs e) { SPReportMap oSPReportMap = new SPReportMap(); SPReportMappingDAL oSPReportMappingDAL = new SPReportMappingDAL(); if (!string.IsNullOrEmpty(ddlSPType.SelectedValue)) { oSPReportMap.SPTypeID = ddlSPType.SelectedValue; } if (!string.IsNullOrEmpty(ddlCommissionClaim.SelectedValue)) { oSPReportMap.CommissionClaimFormat = Convert.ToInt16(ddlCommissionClaim.SelectedValue); } if (!string.IsNullOrEmpty(ddlEncashmentClaim.SelectedValue)) { oSPReportMap.EncashmentClaimFormat = Convert.ToInt16(ddlEncashmentClaim.SelectedValue); } if (!string.IsNullOrEmpty(ddlInterestClaim.SelectedValue)) { oSPReportMap.InterestClaimFormat = Convert.ToInt16(ddlInterestClaim.SelectedValue); } if (!string.IsNullOrEmpty(ddlSaleStatement.SelectedValue)) { oSPReportMap.SalesStatemetFormat = Convert.ToInt16(ddlSaleStatement.SelectedValue); } oSPReportMap.UserDetails = ucUserDet.UserDetail; oSPReportMap.UserDetails.MakeDate = DateTime.Now; ucUserDet.ResetData(); Result oResult = (Result)oSPReportMappingDAL.Save(oSPReportMap); if (oResult.Status) { this.LoadList(); ClearTextValue(); hdSPTypeID.Value = ""; ucMessage.OpenMessage(Constants.MSG_SUCCESS_SAVE, Constants.MSG_TYPE_SUCCESS); } else { ucMessage.OpenMessage(Constants.MSG_ERROR_SAVE, Constants.MSG_TYPE_ERROR); } }
private void LoadDataByID(string sSPTypeID) { SPReportMap oSPReportMap = new SPReportMap(sSPTypeID); SPReportMappingDAL oSPReportMappingDAL = new SPReportMappingDAL(); Result oResult = new Result(); oResult = oSPReportMappingDAL.LoadByID(oSPReportMap); if (oResult.Status) { oSPReportMap = (SPReportMap)oResult.Return; DDListUtil.Assign(ddlCommissionClaim, oSPReportMap.CommissionClaimFormat.ToString()); DDListUtil.Assign(ddlEncashmentClaim, oSPReportMap.EncashmentClaimFormat.ToString()); DDListUtil.Assign(ddlInterestClaim, oSPReportMap.InterestClaimFormat.ToString()); DDListUtil.Assign(ddlSaleStatement, oSPReportMap.SalesStatemetFormat.ToString()); DDListUtil.Assign(ddlSPType, oSPReportMap.SPTypeID.Trim()); ddlSPType.Enabled = false; if (string.IsNullOrEmpty(hdDataType.Value)) { //When Loading from Approver End UserDetails userDetails = ucUserDet.UserDetail; userDetails.MakerID = oSPReportMap.UserDetails.MakerID; userDetails.MakeDate = oSPReportMap.UserDetails.MakeDate; ucUserDet.UserDetail = userDetails; } else if (hdDataType.Value.Equals("T")) { //When loading from temp table UserDetails userDetails = ucUserDet.UserDetail; userDetails.CheckDate = oSPReportMap.UserDetails.CheckDate; userDetails.CheckerID = oSPReportMap.UserDetails.CheckerID; userDetails.CheckDate = oSPReportMap.UserDetails.CheckDate; userDetails.CheckerComment = oSPReportMap.UserDetails.CheckerComment; ucUserDet.UserDetail = userDetails; } hdSPTypeID.Value = sSPTypeID; } else { ucMessage.OpenMessage(Constants.MSG_ERROR_NOT_FOUND, Constants.MSG_TYPE_ERROR); } }
protected void btnApprove_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(hdSPTypeID.Value)) { SPReportMap oSPReportMap = new SPReportMap(hdSPTypeID.Value); SPReportMappingDAL oSPReportMappingDAL = new SPReportMappingDAL(); oSPReportMap.UserDetails = ucUserDet.UserDetail; Result oResult = (Result)oSPReportMappingDAL.Approve(oSPReportMap); if (oResult.Status) { ucMessage.OpenMessage(Constants.MSG_SUCCESS_APPROVE, Constants.MSG_TYPE_SUCCESS); } else { ucMessage.OpenMessage(Constants.MSG_ERROR_APPROVE, Constants.MSG_TYPE_ERROR); } } else { ucMessage.OpenMessage(Constants.MSG_ERROR_APPROVE, Constants.MSG_TYPE_ERROR); } }