protected void loadSLAandAlertDetails() { MainBusinessEntity mBEObj = MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString()); TextBox_Alert_Email.Text = mBEObj.getSupportEmail(); TextBox_New_Defect_Email.Text = mBEObj.getNewSREmailBody(); TextBox_Resolved_Defect_Email.Text = mBEObj.getResolvedSRBody(); ArrayList slaList = DefectSLA.getDefectSLADetailsbyentIdDB(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString(), DefectSLA.DEFECT_TYPE_SERVICE_REQUEST); if (slaList != null && slaList.Count > 0) { DataTable dt = new DataTable(); dt.Columns.Add("Hidden_Type"); dt.Columns.Add("sev"); dt.Columns.Add("sla"); dt.Columns.Add("alertBefore"); for (int i = 0; i < slaList.Count; i++) { DefectSLA slaObj = (DefectSLA)slaList[i]; dt.Rows.Add(); dt.Rows[i]["Hidden_Type"] = slaObj.getContext_Type(); dt.Rows[i]["sev"] = slaObj.getSeverity(); dt.Rows[i]["sla"] = slaObj.getSLA(); dt.Rows[i]["alertBefore"] = slaObj.getAlert_Before(); } GridView1.DataSource = dt; GridView1.DataBind(); GridView1.Visible = true; ViewState["WorkflowDefectSLA" + Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString()] = dt; } }
protected void fillRespQuoteGrid() { DataTable dt = new DataTable(); dt.Columns.Add("RespCompId"); dt.Columns.Add("VendName"); dt.Columns.Add("quote"); dt.Columns.Add("NDA"); dt.Columns.Add("DateVal"); dt.Columns.Add("comm"); dt.Columns.Add("ShortListed"); int counter = 0; Dictionary <String, RFQResponse> respDict = RFQResponse.getAllRFQResponseforRFQIdDB(Session[SessionFactory.ALL_PURCHASE_ALL_RFQ_SELECTED_RFQ_ID].ToString()); DateUtility dU = new DateUtility(); foreach (KeyValuePair <String, RFQResponse> kvp in respDict) { RFQResponse respObj = (RFQResponse)kvp.Value; dt.Rows.Add(); dt.Rows[counter]["RespCompId"] = respObj.getRespEntityId(); dt.Rows[counter]["VendName"] = MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(respObj.getRespEntityId()).getEntityName(); dt.Rows[counter]["DateVal"] = dU.getConvertedDate(respObj.getRespDate()); BackEndObjects.RFQShortlisted shortObj = BackEndObjects.RFQShortlisted. getRFQShortlistedbyRespEntandRFQId(respObj.getRespEntityId(), Session[SessionFactory.ALL_PURCHASE_ALL_RFQ_SELECTED_RFQ_ID].ToString()); if (shortObj != null && shortObj.getRFQId() != null && !shortObj.getRFQId().Equals("")) { dt.Rows[counter]["ShortListed"] = "Y"; } else { dt.Rows[counter]["ShortListed"] = "N"; } counter++; } GridView_RFQ_Resp_Quotes.DataSource = dt; GridView_RFQ_Resp_Quotes.DataBind(); GridView_RFQ_Resp_Quotes.Columns[1].Visible = false; if (dt == null || dt.Rows.Count == 0) { Label_Empty_Quote.Visible = true; } else { Session[SessionFactory.ALL_PURCHASE_ALL_RFQ_ALL_QUOTES_GRID] = dt; } }
protected void fillRespQuoteGrid() { DataTable dt = new DataTable(); dt.Columns.Add("RespCompId"); dt.Columns.Add("VendName"); dt.Columns.Add("quote"); dt.Columns.Add("NDA"); dt.Columns.Add("DateVal"); dt.Columns.Add("comm"); dt.Columns.Add("TotalAmnt"); dt.Columns.Add("DealReq"); ArrayList shortListedList = RFQShortlisted. getAllShortListedEntriesbyRFQId(Session[SessionFactory.ALL_PURCHASE_ALL_RFQ_SELECTED_RFQ_ID].ToString()); DateUtility dU = new DateUtility(); for (int i = 0; i < shortListedList.Count; i++) { RFQShortlisted shortObj = (RFQShortlisted)shortListedList[i]; dt.Rows.Add(); dt.Rows[i]["RespCompId"] = shortObj.getRespEntityId(); dt.Rows[i]["VendName"] = MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(shortObj.getRespEntityId()).getEntityName(); dt.Rows[i]["DateVal"] = dU.getConvertedDate(shortObj.getCreatedDate()); dt.Rows[i]["TotalAmnt"] = shortObj.getPotenAmnt(); dt.Rows[i]["DealReq"] = shortObj.getFinlSupFlag(); } GridView_RFQ_Resp_Quotes.DataSource = dt; GridView_RFQ_Resp_Quotes.DataBind(); GridView_RFQ_Resp_Quotes.Columns[1].Visible = false; //Find out the selected entity if any RFQShortlisted selectedPotObj = RFQShortlisted. getRFQShortlistedEntryforFinalizedVendor(Session[SessionFactory.ALL_PURCHASE_ALL_RFQ_SELECTED_RFQ_ID].ToString()); Session[SessionFactory.ALL_PURCHASE_ALL_RFQ_SHORLISTED_FINALIZED_POTEN] = selectedPotObj.getPotentialId(); foreach (GridViewRow gVR in GridView_RFQ_Resp_Quotes.Rows) { if (((Label)gVR.Cells[0].FindControl("Label_Hidden")).Text.Equals(selectedPotObj.getRespEntityId())) { ((System.Web.UI.WebControls.Image)gVR.Cells[0].FindControl("Image_Selected")).Visible = true; } } }
protected void trySendEmail(String defId, String entId) { MainBusinessEntity mBEObj = MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString()); Dictionary <String, String> contactEmailList = (Dictionary <String, String>)ViewState["createDefectContactEmailList"]; if (mBEObj.getSupportEmail() != null && !mBEObj.getSupportEmail().Equals("") && contactEmailList != null) { try { ActionLibrary.Emails.sendEmail( mBEObj.getSupportEmail(), mBEObj.getSupportEmailPass(), contactEmailList[entId], "Defect Logged with defect id#" + defId, mBEObj.getNewSupportEmailBody()); } catch (Exception ex) { } } }
protected void fillGrid() { String[] contextId = Request.QueryString.GetValues("context"); String[] sourceEnt = Request.QueryString.GetValues("source"); String[] destEnt = Request.QueryString.GetValues("destination"); SortedDictionary <DateTime, BackEndObjects.Communications> allComm = BackEndObjects.Communications. getAllCommunicationsforContextIdBetweenSourceAndDestDB(contextId[0], sourceEnt[0], destEnt[0]); DataTable dt = new DataTable(); dt.Columns.Add("HiddenComm"); dt.Columns.Add("RespDateTime"); dt.Columns.Add("FromUsr"); dt.Columns.Add("FromComp"); dt.Columns.Add("Comments"); int counter = 0; foreach (KeyValuePair <DateTime, BackEndObjects.Communications> kvp in allComm) { BackEndObjects.Communications commObj = kvp.Value; dt.Rows.Add(); dt.Rows[counter]["HiddenComm"] = commObj.getCommId(); dt.Rows[counter]["RespDateTime"] = commObj.getDateCreated(); dt.Rows[counter]["FromUsr"] = commObj.getFromUserId(); dt.Rows[counter]["FromComp"] = MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(commObj.getFromEntityId()).getEntityName(); dt.Rows[counter]["Comments"] = commObj.getText(); counter++; } if (dt.Rows.Count > 0) { GridView_RFQ_Resp_Quotes_Comm.DataSource = dt; GridView_RFQ_Resp_Quotes_Comm.DataBind(); GridView_RFQ_Resp_Quotes_Comm.Visible = true; GridView_RFQ_Resp_Quotes_Comm.Columns[0].Visible = false; } }
protected void fillGrid(String contextId1, String contextId2, String contextId3, String contextTable) { ArrayList contextIdList = new ArrayList(); if (contextId1 != null && !contextId1.Equals("")) { contextIdList.Add(contextId1); } if (contextId2 != null && !contextId2.Equals("")) { contextIdList.Add(contextId2); } if (contextId3 != null && !contextId3.Equals("")) { contextIdList.Add(contextId3); } ArrayList auditDataList = BackEndObjects.AuditData.getAuditRecordsForContextIdsDB(contextIdList, contextTable); Dictionary <String, Dictionary <String, AuditFieldMapping> > mappingDict = (Dictionary <String, Dictionary <String, AuditFieldMapping> >) Cache["AllAuditFieldMapping"]; DataTable dt = new DataTable(); dt.Columns.Add("FieldName"); dt.Columns.Add("FieldValue"); dt.Columns.Add("ChangeTime"); dt.Columns.Add("ChangedUser"); dt.Columns.Add("ChangdOrg"); String entId = Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString(); String orgName = MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(entId).getEntityName(); for (int i = 0; i < auditDataList.Count; i++) { dt.Rows.Add(); BackEndObjects.AuditData auditDataObj = (BackEndObjects.AuditData)auditDataList[i]; Dictionary <String, AuditFieldMapping> tableSpecificMappingDict = null; if (mappingDict.ContainsKey(auditDataObj.getTable_name())) { tableSpecificMappingDict = mappingDict[auditDataObj.getTable_name()]; } if (tableSpecificMappingDict != null && tableSpecificMappingDict.ContainsKey(auditDataObj.getField_name())) { if (tableSpecificMappingDict[auditDataObj.getField_name()].getField_visible().Equals("Y")) { dt.Rows[i]["FieldName"] = tableSpecificMappingDict[auditDataObj.getField_name()].getField_display_name(); } else { continue; } } else { dt.Rows[i]["FieldName"] = auditDataObj.getField_name(); }; dt.Rows[i]["FieldValue"] = auditDataObj.getField_value(); dt.Rows[i]["ChangeTime"] = auditDataObj.getChange_date_time(); dt.Rows[i]["ChangedUser"] = auditDataObj.getChnaged_by_user(); if (!entId.Equals(auditDataObj.getChanged_by_cmp())) { dt.Rows[i]["ChangdOrg"] = MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(auditDataObj.getChanged_by_cmp()).getEntityName(); } else { dt.Rows[i]["ChangdOrg"] = orgName; } } GridView1.DataSource = dt; GridView1.DataBind(); GridView1.Visible = true; }
/// <summary> /// Returns the existing transaction number list /// </summary> /// <returns></returns> protected Dictionary <String, String> fillPmntGrid() { DataTable dt = new DataTable(); dt.Columns.Add("Pmnt_Id"); dt.Columns.Add("Tran_No"); dt.Columns.Add("Pmnt_Type"); dt.Columns.Add("Amount"); dt.Columns.Add("Clearing_Stat"); dt.Columns.Add("Clearing_Stat_Note"); dt.Columns.Add("Pmnt_Date"); dt.Columns.Add("updatedBy"); String invId = Request.QueryString.GetValues("invId")[0]; Dictionary <String, Payment> pmntDict = BackEndObjects.Payment.getPaymentDetailsforInvoiceDB(invId); Dictionary <String, String> tranDict = new Dictionary <String, String>(); DateUtility dU = new DateUtility(); int counter = 0; float totalPmnt = 0; float totalCleared = 0; float totalUnCleared = 0; foreach (KeyValuePair <String, Payment> kvp in pmntDict) { dt.Rows.Add(); Payment pmntObj = kvp.Value; dt.Rows[counter]["Pmnt_Id"] = pmntObj.getPaymentId(); dt.Rows[counter]["Tran_No"] = pmntObj.getTranNo(); dt.Rows[counter]["Pmnt_Type"] = pmntObj.getPaymentType(); dt.Rows[counter]["Amount"] = pmntObj.getAmount(); dt.Rows[counter]["Clearing_Stat"] = pmntObj.getClearingStat(); dt.Rows[counter]["Clearing_Stat_Note"] = pmntObj.getClearingStatNote(); dt.Rows[counter]["Pmnt_Date"] = dU.getConvertedDate(pmntObj.getPmntDate()); String enttId = pmntObj.getEntityid(); String entName = ""; entName = BackEndObjects.Contacts.getContactDetailsforContactEntityDB(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString(), enttId).getContactName(); if (entName == null || entName.Equals("")) { entName = MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(enttId).getEntityName(); } dt.Rows[counter]["updatedBy"] = entName; totalPmnt += pmntObj.getAmount(); totalCleared = pmntObj.getClearingStat().Equals(BackEndObjects.Payment.PAYMENT_CLEARING_STAT_CLEAR) ? totalCleared + pmntObj.getAmount() : totalCleared; totalUnCleared = pmntObj.getClearingStat().Equals(BackEndObjects.Payment.PAYMENT_CLEARING_STAT_PENDING) ? totalUnCleared + pmntObj.getAmount() : totalUnCleared; if (!tranDict.ContainsKey(pmntObj.getTranNo())) { tranDict.Add(pmntObj.getTranNo(), pmntObj.getTranNo()); } counter++; } dt.DefaultView.Sort = "Pmnt_Date" + " " + "DESC"; GridView_Invoice_Pmnt.Visible = true; GridView_Invoice_Pmnt.DataSource = dt.DefaultView.ToTable(); GridView_Invoice_Pmnt.DataBind(); GridView_Invoice_Pmnt.Columns[2].Visible = false; Session[SessionFactory.ALL_INVOICE_PAYMENT_GRID] = dt; Label_Total_Pmnt_Made.Text = totalPmnt.ToString(); Label_Total_Cleared.Text = totalCleared.ToString(); Label_Total_Cleared.ForeColor = System.Drawing.Color.Green; Label_Total_Uncleared.Text = totalUnCleared.ToString(); Label_Total_Uncleared.ForeColor = System.Drawing.Color.Red; return(tranDict); }