public ActionResult AddProvince(GrapherEditModel tmpModel) { string errMsg = ""; AuthenInfo info = new AuthenInfo(); info = (AuthenInfo)HttpContext.Session["LoginInfo"]; GrapherEditModel model = new GrapherEditModel(); model = (GrapherEditModel)HttpContext.Session["GrapherEditModel"]; _cmrWF.insertMapProvince(info.LoginUserID, tmpModel.ProvinceID, out errMsg); var _list = new List<Province>(); _list = _grapherService.getProvinceData(); model.listProvinceException = _grapherService.GetProvinceListExceptionByGrapherID(info.LoginUserID); model.Provinces = _list; Session["GrapherEditModel"] = model; return View("GrapherEdit", model); }
public ActionResult GrapherEdit() { GrapherEditModel model = new GrapherEditModel(); model.GrapherID = 35; //Temp AuthenInfo info = new AuthenInfo(); //info = (AuthenInfo)HttpContext.Session["LoginInfo"]; info.LoginUserID = model.GrapherID; Session["LoginInfo"] = info; string errMsg = ""; string tmpGrapherEmail = ""; string tmpGrapherName = ""; string tmpGrapherSurname = ""; string tmpGrapherPersonalID = ""; string tmpGrapherTelephoneNumber = ""; string tmpGrapherSex = ""; int tmpProvinceID = 0; _cmrWF.getGrapherProfileByGrapherID(model.GrapherID, out errMsg, out tmpGrapherEmail, out tmpGrapherName, out tmpGrapherSurname, out tmpGrapherPersonalID, out tmpGrapherTelephoneNumber, out tmpGrapherSex, out tmpProvinceID); model.GrapherEmail = tmpGrapherEmail; model.GrapherName = tmpGrapherName; model.GrapherSurname = tmpGrapherSurname; model.GrapherPersonalID = tmpGrapherPersonalID; model.GrapherTelephoneNumber = tmpGrapherTelephoneNumber; model.GrapherSex = tmpGrapherSex; if (model.GrapherSex == "1") { model.GrapherSexDisplay = "Male"; } else { model.GrapherSexDisplay = "Female"; } //Event Type double tmpMorningRate = 0; double tmpAfternoonRate = 0; double tmpEveningRate = 0; double tmpFulldayRate = 0; double[,] tmpEarningRate = new double[3,5]; model.EarningRateCongratulation = new double[5]; model.EarningRateWedding = new double[5]; model.EarningRateOther = new double[5]; //model.EventTypeID = 1; for (int iCount = 1; iCount <= 3; iCount++) { model.EventTypeID = iCount; if (!_cmrWF.getGrapherEarningRateProfileByGrapherIDandEventTypeID(model.GrapherID, model.EventTypeID, out errMsg, out tmpMorningRate, out tmpAfternoonRate, out tmpEveningRate, out tmpFulldayRate)) { for (int j = 0; j <= 4; j++) { tmpEarningRate[iCount -1, j] = 0; } } else { //model.EarningRateCongratulation[0] = iCount; //model.MorningRate = tmpMorningRate; //model.AfternoonRate = tmpAfternoonRate; //model.EveningRate = tmpEveningRate; //model.FulldayRate = tmpFulldayRate; tmpEarningRate[iCount - 1, 0] = iCount; tmpEarningRate[iCount - 1, 1] = tmpMorningRate; tmpEarningRate[iCount - 1, 2] = tmpAfternoonRate; tmpEarningRate[iCount - 1, 3] = tmpEveningRate; tmpEarningRate[iCount - 1, 4] = tmpFulldayRate; } //for (int y = 0; y <= 4; y++) //{ // model.EarningRate[iCount - 1, y] = tmpEarningRate[iCount - 1, y]; //} for (int y = 0; y <= 4; y++) { model.EarningRateCongratulation[y] = tmpEarningRate[0, y]; model.EarningRateWedding[y] = tmpEarningRate[1,y]; model.EarningRateOther[y] = tmpEarningRate[2,y]; } } //Province var _list = new List<Province>(); _list = _grapherService.getProvinceData(); model.listProvinceException = _grapherService.GetProvinceListExceptionByGrapherID(info.LoginUserID); model.Provinces = _list; Session["GrapherEditModel"] = model; return View(model); }
public ActionResult RemoveProvince(string ed) { string errMsg = ""; AuthenInfo info = new AuthenInfo(); info = (AuthenInfo)HttpContext.Session["LoginInfo"]; GrapherEditModel model = new GrapherEditModel(); model = (GrapherEditModel)HttpContext.Session["GrapherEditModel"]; int provinceID = Convert.ToInt32(Utility.base64ToString(ed)); _cmrWF.deleteMapProvince(info.LoginUserID, provinceID, out errMsg); var _list = new List<Province>(); _list = _grapherService.getProvinceData(); model.listProvinceException = _grapherService.GetProvinceListExceptionByGrapherID(info.LoginUserID); model.Provinces = _list; Session["GrapherEditModel"] = model; return View("GrapherEdit", model); }