Esempio n. 1
0
        public HttpResponseMessage WaiterChangePwd(HttpRequestMessage req, RP_WaiterChangePwd rpWaiterChangePwd)
        {
            if (rpWaiterChangePwd != null)
            {
                RM_WaiterChangePwd rmWaiterChangePwd = new RM_WaiterChangePwd();
                List<RPR_WaiterChangePwd> rprWaiterChangePwd = rmWaiterChangePwd.WaiterChangePwd(rpWaiterChangePwd);

                if (rmWaiterChangePwd._IsSuccess)
                    return req.CreateResponse<List<RPR_WaiterChangePwd>>(HttpStatusCode.Created, rprWaiterChangePwd);

                return req.CreateErrorResponse(HttpStatusCode.InternalServerError, "ServerError");
            }

            return req.CreateErrorResponse(HttpStatusCode.BadRequest, "Bad Request");
        }
Esempio n. 2
0
        public List<RPR_WaiterChangePwd> WaiterChangePwd(RP_WaiterChangePwd rpWaiterChangePwd)
        {
            this.SpName = "DigitalMenu_ChangeWaiterPwd"; //Sp Name
                  _IsSuccess = true;
                  try
                  {
                      SqlParameter[] param = new SqlParameter[5];
                      param[0] = new SqlParameter("@key", rpWaiterChangePwd.key);
                      param[1] = new SqlParameter("@WaiterId", rpWaiterChangePwd.WaiterId);
                      param[2] = new SqlParameter("@RestId", int.Parse(rpWaiterChangePwd.RestId));
                      param[3] = new SqlParameter("@NewPwd", rpWaiterChangePwd.NewPwd);
                      param[4] = new SqlParameter("@OldPwd", rpWaiterChangePwd.OldPwd);

                      ds = db.GetDataSet(this.SpName, param);
                      if (ds != null && ds.Tables.Count > 0)
                      {
                          rprUpdateWaiterProfile = SerializeData.SerializeMultiValue<RPR_WaiterChangePwd>(ds.Tables[0]);
                      }
                  }
                  catch (Exception ex)
                  {
                      _IsSuccess = false;
                      Logger.WriteLog(LogLevelL4N.ERROR, " update  waiter profile  | Exception : " + ex.Message);
                  }
                  return rprUpdateWaiterProfile;
        }