Beispiel #1
0
        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);
        }
Beispiel #2
0
 private void InitProvinceData(ref List<Province> list)
 {
     try
     {
         DataSet ds = null;
         DataTable dt = null;
         string errMsg = "";
         AuthenInfo info = new AuthenInfo();
         info = (AuthenInfo)HttpContext.Current.Session["LoginInfo"];
         if (_cmrWS.getProvinceListByGrapherID(info.LoginUserID, out ds, out errMsg))
         {
             dt = ds.Tables[0];
             //dt.AsEnumerable().ToList();
             list = (from DataRow row in dt.Rows
                     select new Province
                     {
                         RowNo = Convert.ToInt16(row["rowNumber"]),
                         ProvinceID = Convert.ToInt16(row["PROVINCEID"]),
                         ProvinceName = Convert.ToString(row["PROVINCENAME"])
                     }).ToList();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #3
0
 public void SignOff()
 {
     string errMsg = string.Empty;
     AuthenInfo _info = new AuthenInfo();
     _info = (AuthenInfo)HttpContext.Current.Session["LoginInfo"];
     bool success = _cmrWS.forceGrapherLogout((_info.LoginUserID).ToString(), out errMsg);
     HttpContext.Current.Session.Abandon();
     if (!success)
     {
         //WriteLog(errMsg);
     }
 }
Beispiel #4
0
        public void SetAuthenInfo(string user)
        {
            string errMsg = "";
            DataSet ds = new DataSet();
            if (!_cmrWS.getGrapherInfo(user, out ds, out errMsg))
            {
                //WriteLog("getUserInfo (Error) : " + errMsg);
            }

            if (ds != null)
            {
                AuthenInfo info = new AuthenInfo();
                info.With(m =>
                {
                    m.LoginUserID = Convert.ToInt64(ds.Tables[0].Rows[0]["GRAPHERID"]); ;
                    m.LoginUserName = Convert.ToString(ds.Tables[0].Rows[0]["NAME"]);
                    m.ClientIP = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
                    m.UserLevel = Convert.ToString(ds.Tables[0].Rows[0]["GRAPHERLEVEL"]);
                    m.LastLogin = DateTime.Now;

                });

                HttpContext.Current.Session["LoginInfo"] = info;
                System.Web.SessionState.HttpSessionState ss = HttpContext.Current.Session;
                //Updated login info.
                //UpdateAuthenUsers(info, ss.SessionID);
                if (!_cmrWS.updatedAuthenGrapher(Convert.ToString(info.LoginUserID), info.ClientIP, ss.SessionID, out errMsg))
                {
                    //WriteLog("updatedAuthenUser (Error) : " + errMsg);
                }
            }
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
 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);
 }