private IList <PmsHeadCountByContent> GetPmsHeadCountByContentList(DataSet dsExcel) { IList <PmsHeadCountByContent> listPmsHeadCountByContent = new List <PmsHeadCountByContent>(); DataTable dtExcel = new DataTable(); dtExcel = dsExcel.Tables["SUMMARY"]; PmsHeadCountByContent pmsHeadCountByContent = new PmsHeadCountByContent(); for (int k = 1; k < dtExcel.Rows.Count; k++) { string role = dtExcel.Rows[k]["F1"].ToString().ToUpper().Trim(); switch (role) { case "SD": case "SE": case "QA": listPmsHeadCountByContent = AddPmsHeadCountByContent(listPmsHeadCountByContent, dtExcel.Rows[k], role); break; default: break; } } return(listPmsHeadCountByContent); }
private IList <PmsHeadCountByContent> AddPmsHeadCountByContent(IList <PmsHeadCountByContent> listPmsHeadCountByContent, DataRow dtExcelRows, string role) { PmsHeadCountByContent pmsHeadCountByContent = new PmsHeadCountByContent(); string vB2NetHeadCount = dtExcelRows["F12"].ToString(); pmsHeadCountByContent = GetPmsHeadCountByContent(role, "VB2NET", vB2NetHeadCount); listPmsHeadCountByContent.Add(pmsHeadCountByContent); return(listPmsHeadCountByContent); }
private PmsHeadCountByContent GetPmsHeadCountByContent(string role, string contentType, string headCount) { PmsHeadCountByContent pmsHeadCountByContent = new PmsHeadCountByContent(); pmsHeadCountByContent.Vid = "PM"; pmsHeadCountByContent.YearAndMonth = DropDownListYearMonth.SelectedValue.Trim(); pmsHeadCountByContent.RequirementPeriod = DropDownListWeekPeriod.SelectedValue.Trim(); pmsHeadCountByContent.ContentType = contentType; pmsHeadCountByContent.Role = role; pmsHeadCountByContent.HeadCount = float.Parse(headCount); pmsHeadCountByContent.Createdate = System.DateTime.Now; pmsHeadCountByContent.Createuser = WSC.GlobalDefinition.Cookie_LoginUser.Replace(" ", "."); return(pmsHeadCountByContent); }
public bool InsertPmsRequirement(IList <PmsRequirement> listPmsRequirement, IList <PmsHeadCount> listPmsHeadCount, IList <PmsHeadCountByContent> listPmsHeadCountByContent) { try { m_PMSSqlConnection.BeginTransaction(); if (listPmsRequirement.Count > 0) { PmsRequirement pmsRequirement = listPmsRequirement.FirstOrDefault(); m_PMSSqlConnection.Delete("DeletePmsRequirement", pmsRequirement); } if (listPmsHeadCount.Count > 0) { PmsHeadCount pmsHeadCount = listPmsHeadCount.FirstOrDefault(); m_PMSSqlConnection.Delete("DeletePmsHeadCount", pmsHeadCount); } if (listPmsHeadCountByContent.Count > 0) { PmsHeadCountByContent pmsHeadCountByContent = listPmsHeadCountByContent.FirstOrDefault(); m_PMSSqlConnection.Delete("DeletePmsHeadCountByContent", pmsHeadCountByContent); } foreach (var pmsRequirement in listPmsRequirement) { m_PMSSqlConnection.Insert("InsertPmsRequirement", pmsRequirement); } foreach (var pmsHeadCount in listPmsHeadCount) { m_PMSSqlConnection.Insert("InsertPmsHeadCount", pmsHeadCount); } foreach (var pmsHeadCountByContent in listPmsHeadCountByContent) { m_PMSSqlConnection.Insert("InsertPmsHeadCountByContent", pmsHeadCountByContent); } m_PMSSqlConnection.CommitTransaction(); return(true); } catch (Exception ex) { m_PMSSqlConnection.RollBackTransaction(); m_Logger.Error("PmsRequirementBiz/InsertPmsRequirement:" + ex.ToString()); return(false); } }