예제 #1
0
        public void MakeReservation(string userPersistentId, string roomUuid, string start, string end, string mpk, string katering, string roomName, string desc, string isrec, string recrule,
                                    string kateringDodatkoweInfo, string kateringDostawa, string iloscOsob)
        {
            string wsurl = Helpers.GetSetting("CAwsurl", false);

            //string cs = Helpers.GetSetting("sdmdb", true);
            try
            {
                string pcat = GetRoomReservationPersistentId();
                if (!string.IsNullOrEmpty(pcat))
                {
                    SDMWebServiceHelper helper = new SDMWebServiceHelper(wsurl, Helpers.GetSetting("CALogin", false), Helpers.GetSetting("CAPassword", true));
                    helper.CreateRequest(pcat, userPersistentId, roomUuid, start, end, mpk, katering, roomName, desc, isrec, recrule, kateringDodatkoweInfo, kateringDostawa, iloscOsob);
                }
                else
                {
                    throw new Exception("Nie znaleziono persistent_id dla Administracja.Rezerwacja sali");
                }
            }
            catch (Exception ex)
            {
                Context.Response.StatusCode        = (int)HttpStatusCode.InternalServerError;
                Context.Response.StatusDescription = ex.Message;
            }
        }
예제 #2
0
        public void CancelReservation(string persid, string cancelAll)
        {
            string wsurl = Helpers.GetSetting("CAwsurl", false);

            string rescode = string.Empty;
            string cs      = Helpers.GetSetting("sdmdb", true);

            using (SqlConnection connection = new SqlConnection(cs))
            {
                connection.Open();
                string     cmd        = "select persid from usp_resolution_code where del = 0 and sym like 'Anulowane przez u_ytkownika'";
                SqlCommand sqlCommand = new SqlCommand(cmd, connection);
                object     o          = sqlCommand.ExecuteScalar();
                if (o != null)
                {
                    rescode = o.ToString();
                }
            }

            SDMWebServiceHelper helper = new SDMWebServiceHelper(wsurl, Helpers.GetSetting("CALogin", false), Helpers.GetSetting("CAPassword", true));

            helper.CancelReservation(persid, rescode, cancelAll);
        }