Beispiel #1
0
        public Object TicketTypesPost([FromBody] SupportInput si)
        {
            string    sJSONResponse  = "";
            DataTable dt_AppType     = new DataTable();
            string    ServerDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
            int       a = 0;
            string    olPackage_Query = "insert into TicketTypes(RequestType) values('" + si.RequestType + "')";

            SupportOutput ffopt = new SupportOutput();

            try
            {
                cnn.Open();

                SqlCommand tm_cmd = new SqlCommand(olPackage_Query, cnn);
                tm_cmd.ExecuteNonQuery();
                ffopt.status = "Success";
            }
            catch (Exception ex)
            {
                ffopt.status = "Fail";
            }
            finally
            {
                cnn.Close();
            }

            sJSONResponse = JsonConvert.SerializeObject(ffopt);

            return(sJSONResponse);
        }
Beispiel #2
0
        public Object TicketTransactionUpdate([FromBody] SupportInput si)
        {
            string        sJSONResponse  = "";
            DataTable     dt_AppType     = new DataTable();
            string        ServerDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
            int           a = 0;
            string        olPackage_Query = "";
            SupportOutput ffopt           = new SupportOutput();

            try
            {
                cnn.Open();

                olPackage_Query = "update TicketTransaction set TicketId='" + si.TicketId + "',RequestTypeId='" + si.RequestTypeId + "',BranchCode='" + si.BranchCode + "',MemberShipCode='" + si.MemberShipCode + "',InvoiceId='" + si.InvoiceId + "',Comments='" + si.Comments + "', StatusId = '" + si.StatusId + "',StatusName = '" + si.StatusName + "' where ID=" + si.ID + " ";
                SqlCommand tm_cmd = new SqlCommand(olPackage_Query, cnn);
                tm_cmd.ExecuteNonQuery();
                ffopt.status = "Success";
            }
            catch (Exception ex)
            {
                ffopt.status = "Fail";
            }
            finally
            {
                cnn.Close();
            }

            sJSONResponse = JsonConvert.SerializeObject(ffopt);

            return(sJSONResponse);
        }
Beispiel #3
0
        public Object TicketTransactionPost([FromBody] SupportInput si)
        {
            string    sJSONResponse  = "";
            DataTable dt_AppType     = new DataTable();
            string    ServerDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
            int       a = 0;
            string    olPackage_Query = "insert into TicketTransaction(TicketId,RequestTypeId,BranchCode,MemberShipCode,InvoiceId,StatusId,StatusName,PostPoneDate,Comments,CreatedBy,CreatedOn,IsDeleted,IsActive) values('" + si.TicketId + "','" + si.RequestTypeId + "','" + si.BranchCode + "','" + si.MemberShipCode + "','" + si.InvoiceId + "','" + si.StatusId + "','" + si.StatusName + "','" + si.PostPoneDate + "','" + si.Comments + "','" + si.CreatedBy + "','" + ServerDateTime + "',0,1)";

            SupportOutput ffopt = new SupportOutput();

            try
            {
                cnn.Open();

                SqlCommand tm_cmd = new SqlCommand(olPackage_Query, cnn);
                tm_cmd.ExecuteNonQuery();
                ffopt.status = "Success";
            }
            catch (Exception ex)
            {
                ffopt.status = "Fail";
            }
            finally
            {
                cnn.Close();
            }

            sJSONResponse = JsonConvert.SerializeObject(ffopt);

            return(sJSONResponse);
        }
Beispiel #4
0
        public Object TicketBookingPost([FromBody] SupportInput si)
        {
            string    sJSONResponse  = "";
            DataTable dt_AppType     = new DataTable();
            string    ServerDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);
            int       a = 0;

            DataTable dt_LID = new DataTable();

            dt_LID = getdata(string.Format("select ISNULL(MAX(ID),0) as LID from TicketBooking"));

            string TicketId = "";
            int    count    = 0;

            count    = Convert.ToInt32(dt_LID.Rows[0]["LID"].ToString()) + 1;
            TicketId = si.BranchCode + Convert.ToString(count);

            SupportOutput ffopt = new SupportOutput();

            cnn.Open();
            SqlCommand     command = cnn.CreateCommand();
            SqlTransaction transaction;

            transaction         = cnn.BeginTransaction("SampleTransaction");
            command.Connection  = cnn;
            command.Transaction = transaction;

            try
            {
                command.CommandText = "insert into TicketBooking(TicketId,RequestTypeId,BranchCode,MemberShipCode,InvoiceId,Comments,CreatedBy,CreatedOn,IsDeleted,IsActive) values('" + TicketId + "','" + si.RequestTypeId + "','" + si.BranchCode + "','" + si.MemberShipCode + "','" + si.InvoiceId + "','" + si.Comments + "','" + si.CreatedBy + "','" + ServerDateTime + "',0,1)";
                command.ExecuteNonQuery();
                command.CommandText = "insert into TicketTransaction(TicketId,RequestTypeId,BranchCode,MemberShipCode,InvoiceId,StatusId,StatusName,PostPoneDate,Comments,CreatedBy,CreatedOn,IsDeleted,IsActive) values('" + TicketId + "','" + si.RequestTypeId + "','" + si.BranchCode + "','" + si.MemberShipCode + "','" + si.InvoiceId + "','1','Pending','','" + si.Comments + "','" + si.CreatedBy + "','" + ServerDateTime + "',0,1)";
                command.ExecuteNonQuery();
                transaction.Commit();
                ffopt.status = "Success";
            }
            catch (Exception ex)
            {
                try
                {
                    transaction.Rollback();
                }
                catch (Exception ex2)
                {
                }
                ffopt.status = "Fail";
            }
            finally
            {
                cnn.Close();
            }

            sJSONResponse = JsonConvert.SerializeObject(ffopt);

            return(sJSONResponse);
        }
Beispiel #5
0
        public Object TicketTransactionDelete([FromBody] SupportInput si)
        {
            string        sJSONResponse  = "";
            SupportOutput ffopt          = new SupportOutput();
            SqlCommand    command        = cnn.CreateCommand();
            string        ServerDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture);

            try
            {
                cnn.Close();
                cnn.Open();
                SqlTransaction transaction;
                transaction         = cnn.BeginTransaction("SampleTransaction");
                command.Connection  = cnn;
                command.Transaction = transaction;
                try
                {
                    command.CommandText = "delete from TicketTransaction where ID=" + si.ID + " ";
                    command.ExecuteNonQuery();

                    transaction.Commit();
                }
                catch (Exception ex)
                {
                    transaction.Rollback();
                }
                finally
                {
                    ffopt.status = "success";
                }
            }
            catch (Exception ec)
            {
            }

            sJSONResponse = JsonConvert.SerializeObject(ffopt);

            return(sJSONResponse);
        }